X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=nagios%2Fplc_users_to_nagios.py;h=815237f90f5707eda7985342107633f509eadc33;hb=3b9ead50a3cb587677eb550dbd59732ec108ddbc;hp=477157837f9b70b4fab58c4eb5b7dbc839e50f0b;hpb=6e54bcb39102e76565aa6d209fa83f9d35f39532;p=monitor.git diff --git a/nagios/plc_users_to_nagios.py b/nagios/plc_users_to_nagios.py index 4771578..815237f 100755 --- a/nagios/plc_users_to_nagios.py +++ b/nagios/plc_users_to_nagios.py @@ -40,18 +40,18 @@ def getContactsAndContactGroupsFor(lb, type, email_list): host_email_command = Command(command_name="monitor-notify-host-by-email", - command_line="""/usr/share/monitor/nagios/actions/mail.py --hostnotificationnumber $HOSTNOTIFICATIONNUMBER$ --notificationtype $NOTIFICATIONTYPE$ --hostname $HOSTNAME$ --hoststate $HOSTSTATE$ --hostaddress $HOSTADDRESS$ --hostoutput "$HOSTOUTPUT$" --longdatetime "$LONGDATETIME$" --notificationitype $NOTIFICATIONTYPE$ --contactemail $CONTACTEMAIL$""") + command_line="""/usr/share/monitor/nagios/actions/mail.py --servicenotificationnumber $SERVICENOTIFICATIONNUMBER$ --hostnotificationnumber $HOSTNOTIFICATIONNUMBER$ --notificationtype $NOTIFICATIONTYPE$ --hostname $HOSTNAME$ --hoststate $HOSTSTATE$ --hostaddress $HOSTADDRESS$ --hostoutput "$HOSTOUTPUT$" --longdatetime "$LONGDATETIME$" --notificationitype $NOTIFICATIONTYPE$ --contactemail $CONTACTEMAIL$""") service_email_command = Command(command_name="monitor-notify-service-by-email", - command_line="""/usr/bin/printf "%b" "***** MyOpsNagios $HOSTNOTIFICATIONNUMBER$ *****\\n\\nNotification Type: $NOTIFICATIONTYPE$\\n\\nService: $SERVICEDESC$\\nHost: $HOSTALIAS$\\nAddress: $HOSTADDRESS$\\nState: $SERVICESTATE$\\n\\nDate/Time: $LONGDATETIME$\\n\\nAdditional Info:\\n\\n$SERVICEOUTPUT$" | /bin/mail -S replyto=monitor@planet-lab.org -s "** $NOTIFICATIONTYPE$ Service Alert: $HOSTALIAS$/$SERVICEDESC$ is $SERVICESTATE$ **" $CONTACTEMAIL$""") + command_line="""/usr/bin/printf "%b" "***** MyOpsNagios $SERVICENOTIFICATIONNUMBER$ $HOSTNOTIFICATIONNUMBER$ *****\\n\\nNotification Type: $NOTIFICATIONTYPE$\\n\\nService: $SERVICEDESC$\\nHost: $HOSTALIAS$\\nAddress: $HOSTADDRESS$\\nState: $SERVICESTATE$\\n\\nDate/Time: $LONGDATETIME$\\n\\nAdditional Info:\\n\\n$SERVICEOUTPUT$" | /bin/mail -S replyto=monitor@planet-lab.org -s "** $NOTIFICATIONTYPE$ Service Alert: $HOSTALIAS$/$SERVICEDESC$ is $SERVICESTATE$ **" $CONTACTEMAIL$""") print host_email_command.toString() print service_email_command.toString() -from monitor.wrapper import plc -from monitor.generic import * +import plc +from generic import * l_sites = plc.api.GetSites({'login_base' : ['asu', 'gmu', 'gt']})