]> git.uio.no Git - uio-zabbix.git/blobdiff - zabbix_elasticsearch_cluster_health.py
Use env python header + Upgrade code to support python3 [GID-1248]
[uio-zabbix.git] / zabbix_elasticsearch_cluster_health.py
index ec231173056012d3db1472735b7de0d0e4181e93..6cc868a8de8da18834b4b4f4a7fde4f2a559c1d2 100755 (executable)
@@ -1,4 +1,4 @@
-#!/usr/bin/python2
+#!/usr/bin/env python
 #
 # Authors:
 # rafael@postgresql.org.es / http://www.postgresql.org.es/
@@ -112,8 +112,8 @@ def get_cluster_health_data(node_fqdn):
 
         result = getKeys(health_data,health_keys,node_fqdn)
 
-    except Exception, e:
-        print "1"
+    except Exception as e:
+        print ("1")
         sys.exit(1)
 
     return result
@@ -152,19 +152,19 @@ if __name__ == '__main__':
                     break
 
             if returncode != 0:
-                print "1"
+                print ("1")
                 sys.exit(1)
             
         else:
-            print "1"
+            print ("1")
             sys.exit(1)
 
-    except Exception, e:
-        print "1"
+    except Exception as e:
+        print ("1")
         sys.exit(1)
 
     # Delete temp file with zabbix_sender data
     os.remove(tmp_stat_file.name)
 
     # Return value 0 = execution OK
-    print "0"
+    print ("0")