Python error executing command
Posted: Thu Sep 13, 2018 3:12 am
I'm trying to send a notification to Telegram.
I've got a python script that I am calling to send the notification but getting a module import error. I've tried installing the missing module but not having any luck.
Here is my code for the command.
This is the code for the python script that I am using. https://github.com/dariomas/nagios_tele ... elegram.py
I have tried to execute the script outside of Nagios and it was working so why it won't load the modules I don't know any help would be appreciated.
Thanks
Jonathan
I've got a python script that I am calling to send the notification but getting a module import error. I've tried installing the missing module but not having any luck.
Here is my code for the command.
Code: Select all
define command {
command_name notify-service-by-telegram
command_line /usr/local/bin/nagios_telegram.py --token $USER4$ --object_type service --contact $USER3$ --notificationtype "$NOTIFICATIONTYPE$" --servicestate "$SERVICESTATE$" --hostname "$HOSTNAME$" --hostaddress "$HOSTADDRESS$" --datetime "$LONGDATETIME$" --output "$SERVICEOUTPUT$" --servicedesc "$SERVICEDESC$" --servicename "$SERVICENAME$"
}
I have tried to execute the script outside of Nagios and it was working so why it won't load the modules I don't know any help would be appreciated.
Thanks
Jonathan