X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=nagios%2Fplc_users_to_nagios.py;h=207a4d22753b710748d12f8f275b7d1371987c5b;hb=5f22fdfd8456bfcf0a050e1bb31b0bd0bf3c3d74;hp=114dcf0670eb0ab01249a01a69e1f60d84681a21;hpb=e731b7a3adad1efb3b13a0dcb06671a497754f0b;p=monitor.git diff --git a/nagios/plc_users_to_nagios.py b/nagios/plc_users_to_nagios.py index 114dcf0..207a4d2 100755 --- a/nagios/plc_users_to_nagios.py +++ b/nagios/plc_users_to_nagios.py @@ -40,7 +40,7 @@ def getContactsAndContactGroupsFor(lb, type, email_list): host_email_command = Command(command_name="monitor-notify-host-by-email", - command_line="""/usr/share/monitor/commands/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 --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$""") @@ -50,8 +50,8 @@ 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']})