Page 1 of 1
Python checks
Posted: Thu Dec 15, 2016 10:21 am
by chrisbooth
I've made a python script that runs correctly from bash terminal like this
Code: Select all
root@localhost(/tmp):python merge -H 10.101.24.97 -U nagios -P Nagios123 -T sensor-status
SENSORS OK
but i'm not sure the correct way to do this as a check
i've tried this but it doesn't work
Screen Shot 2016-12-15 at 15.12.34.png
Re: Python checks
Posted: Thu Dec 15, 2016 2:29 pm
by tmcdonald
I would take a look over our KB article:
https://support.nagios.com/kb/article.php?id=167
You are running this as root on the command line, but apache in the test check button, and if it were run normally it would be as nagios. Try running the commands as the apache and nagios users and see if you get any meaningful output.
Re: Python checks
Posted: Thu Dec 15, 2016 2:44 pm
by rkennedy
One thing to add - it looks like you specified 'merge' in your test, but the GUI is showing 'check_dothill' - is this on purpose?
Re: Python checks
Posted: Thu Dec 15, 2016 4:08 pm
by chrisbooth
sorry yes i renamed it corrected after i had tested it and it also runs ok with the nagios account.
i see your KB article but there's no mention of python so maybe i'm missing something.
sorry if i'm missing the obvious
Re: Python checks
Posted: Thu Dec 15, 2016 4:55 pm
by chrisbooth
i found the solution
[
[email protected] ~]# /usr/bin/python /usr/local/nagios/libexec/check_dothill -H 10.101.24.97 -U nagios -P Nagios123 -T sensor-status
SENSORS OK
http://stackoverflow.com/questions/1618 ... -in-nagios
Re: Python checks
Posted: Thu Dec 15, 2016 5:31 pm
by rkennedy
Awesome - are we good to mark this thread as resolved?