]> git.uio.no Git - uio-zabbix.git/blobdiff - zabbix_get_rabbitmq_stats.py
Bugfix, fix Popen call - zabbix_get_rabbitmq_stats.py
[uio-zabbix.git] / zabbix_get_rabbitmq_stats.py
old mode 100644 (file)
new mode 100755 (executable)
index 5bcaa3c..280c205
@@ -77,7 +77,7 @@ def get_rabbitmq_data(component):
         request_data = requests.get("http://127.0.0.1:15672/api/" + component ,auth=(username,password))
                 
         if request_data.status_code != 200:
-            raise Exception("[ERROR]: Problems connecting to logstash stats API\n")
+            raise Exception("[ERROR]: Problems connecting to rabbitMQ stats API\n")
             
         data = request_data.json()
 
@@ -178,6 +178,10 @@ if __name__ == '__main__':
 
     try:
 
+        #
+        # We send data about queues, nodes and cluster to Zabbix
+        #
+        
         for component in ['queues','nodes','overview']:
 
             # Temp file with full json output
@@ -196,7 +200,7 @@ if __name__ == '__main__':
                
             #
             # The monitoring of this host can be done by any of the
-            # zabbix proxyer defined in zabbix_proxy[]. We try all of
+            # zabbix proxies defined in zabbix_proxy[]. We try all of
             # them until one of them accepts our data
             #
         
@@ -204,7 +208,7 @@ if __name__ == '__main__':
 
                 command = zabbix_sender + ' -z ' + proxy + ' -i ' + tmp_stat_file.name + ' > /dev/null 2>&1'
                 
-                proc = subprocess.Popen([command],stdout=subprocess.STDOUT,stderr=subprocess.STDOUT,shell=True)
+                proc = subprocess.Popen([command],shell=True)
                 proc.wait()
                 
                 if proc.returncode == 0: