Python checks

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
chrisbooth
Posts: 43
Joined: Thu Dec 01, 2016 10:09 am

Python checks

Post 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
You do not have the required permissions to view the files attached to this post.
tmcdonald
Posts: 9117
Joined: Mon Sep 23, 2013 8:40 am

Re: Python checks

Post 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.
Former Nagios employee
rkennedy
Posts: 6579
Joined: Mon Oct 05, 2015 11:45 am

Re: Python checks

Post 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?
Former Nagios Employee
chrisbooth
Posts: 43
Joined: Thu Dec 01, 2016 10:09 am

Re: Python checks

Post 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
chrisbooth
Posts: 43
Joined: Thu Dec 01, 2016 10:09 am

Re: Python checks

Post 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
rkennedy
Posts: 6579
Joined: Mon Oct 05, 2015 11:45 am

Re: Python checks

Post by rkennedy »

Awesome - are we good to mark this thread as resolved?
Former Nagios Employee
Locked