Leif Ryge avatar Leif Ryge committed 21d32df Merge

client release 8.2013.04.23.22.11.52-a36f144fddb5 (from default)

Comments (0)

Files changed (5)

client_package/ChangeLog

+8.2013.04.23.22.11.52-a36f144fddb5
+
+  * Made data-tool checkmetric not pretty-print output
+  * Add documentation about nagios/icinga
+
 8.2013.04.17.01.40.45-39a67fc85995
 
   * made data-tool checkmetric exit with status 2 if not OK

client_package/RELEASE_VERSION

-8.2013.04.17.01.40.45-39a67fc85995
+8.2013.04.23.22.11.52-a36f144fddb5

client_package/UPGRADING

+Upgrading from 8.2013.04.17.01.40.45-39a67fc85995
+  * No special upgrade steps required
+
 Upgrading from 8.2013.04.17.00.39.39-73c0d969a1bb
   * No special upgrade steps required
 

client_package/debian/changelog

+statmoverclient (8.2013.04.23.22.11.52-a36f144fddb5) precise; urgency=low
+
+  * Made data-tool checkmetric not pretty-print output
+  * Add documentation about nagios/icinga
+
+ -- Leif Ryge <leif@statmover.com>  Tue, 23 Apr 2013 15:11:54 -0700
+
 statmoverclient (8.2013.04.17.01.40.45-39a67fc85995) precise; urgency=low
 
   * made data-tool checkmetric exit with status 2 if not OK 

src/python/statmoverclient/data_tool.py

 from statmoverclient.cli        import SaturnaliaOptionParser
 from statmoverclient.restclient import SaturnaliaRESTClient
 
+NAGIOS_CRITICAL_STATUS = 2
 
 USAGE = """\
 %prog COMMAND [...]
 
     result = client.checkmetric( checkType, name, intervalMs, min, max )
 
-    json.dump( result, sys.stdout, indent=2 )
+    json.dump( result, sys.stdout )
     sys.stdout.write('\n')
 
     if result["result"] == "OK":
         return 0
 
     else:
-        return 2
+        return NAGIOS_CRITICAL_STATUS
 
 
 checkmetric.ArgCount = 5
 
   MIN and MAX are floating point numbers. "inf" and "-inf" are
   valid inputs.
+
+  The result will be printed as a one-line json document. If the value is not
+  within the target range, the exit status will be 2, making this command
+  suitable for use in a nagios or icinga command definition.
 """
 
 Commands = {
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.