Fix cepmon-nagios unknown errors

RESOLVED WONTFIX

Status

Cloud Services
Operations
RESOLVED WONTFIX
5 years ago
2 years ago

People

(Reporter: gene, Unassigned)

Tracking

Firefox Tracking Flags

(Not tracked)

Details

(Reporter)

Description

5 years ago
Update cepmon-nagios ( https://github.com/fetep/cepmon-nagios ) to log the conditions when it's going to return an error code of 3 or more ( http://nagiosplug.sourceforge.net/developer-guidelines.html#AEN76 ).

At the moment intermittently cepmon-nagios returns unknown and I don't know what's causing it. During this time, I don't know if we're in an error state that should be alerting that isn't or a good state that shouldn't be alerting.
(Reporter)

Comment 1

5 years ago
Here's how to get it and build it once it's fixed : https://intranet.mozilla.org/Services/Ops/Cepmon#cepmon-nagios
This patch should at least reflect the reason for the unknown in the nagios alert itself.

--- x/check_cepmon	2013-01-02 14:50:34.808919792 -0600
+++ y/check_cepmon	2013-01-02 14:52:01.439539488 -0600
@@ -29,15 +29,15 @@
     alerts_json = Net::HTTP.get_response(cepmon_uri)
     alerts = JSON.parse(alerts_json.body)
 rescue Net::HTTPExceptions
-    $stderr.puts "UNKNOWN: error fetching #{cepmon_uri.to_s}: #{$!}"
+    puts "UNKNOWN: error fetching #{cepmon_uri.to_s}: #{$!}"
     exit 3
 rescue JSON::ParserError
-    $stderr.puts "UNKNOWN: error parsing JSON from #{cepmon_uri.to_s}: #{$!}"
+    puts "UNKNOWN: error parsing JSON from #{cepmon_uri.to_s}: #{$!}"
     exit 3
 end
 
 if !alerts.is_a?(Hash) or !alerts["alerts"].is_a?(Array)
-    $stderr.puts "UNKNOWN: error parsing JSON from #{cepmon_uri.to_s}: " +
+    puts "UNKNOWN: error parsing JSON from #{cepmon_uri.to_s}: " +
                  "missing alerts field"
     exit 3
 end

Updated

2 years ago
Status: NEW → RESOLVED
Last Resolved: 2 years ago
Resolution: --- → WONTFIX
You need to log in before you can comment on or make changes to this bug.