X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=nagios%2Fplc_hosts_to_nagios.py;h=3b36ecdef1ef9b7faaa6019e1bea4cd13715bb9b;hb=5f22fdfd8456bfcf0a050e1bb31b0bd0bf3c3d74;hp=302db9e17c174c55e59c47c4d2aa23aa982c0092;hpb=dcf94cd60b68ca3a3cd38a55d32bdf49b4639b99;p=monitor.git diff --git a/nagios/plc_hosts_to_nagios.py b/nagios/plc_hosts_to_nagios.py index 302db9e..3b36ecd 100755 --- a/nagios/plc_hosts_to_nagios.py +++ b/nagios/plc_hosts_to_nagios.py @@ -1,5 +1,8 @@ #!/usr/bin/python + +import plc from nagiosobjects import * +from generic import * command_auto = Command(command_name="check_mode", command_line="""/usr/share/monitor/nagios/plugins/checkmode.py -H $HOSTNAME$ --sn $SERVICENOTIFICATIONNUMBER$ """) @@ -123,8 +126,6 @@ globalhost = [Host( name="planetlab-host", for obj in globalhost + globalservices: print obj.toString() -from monitor.wrapper import plc -from monitor.generic import * l_sites = plc.api.GetSites({'login_base' : ['asu', 'gmu', 'gt']}) #l_sites = plc.api.GetSites([10243, 22, 10247, 138, 139, 10050, 10257, 18, 20, @@ -298,9 +299,10 @@ for site in l_sites: s3 = Service(use="planetlab-service", host_name=hn_list, service_description="cPCU", + notes_url="http://www.planet-lab.org/db/sites/index.php?id=%s" % site['site_id'], display_name="cPCU", servicegroups="NET,PCU", - notifications_enabled="0", + notifications_enabled="1", check_command="check_pcu") # NOTE: try to repair the host, if it is online and 'mode' indicates a problem