how to plugin python scripts in nagios xi ?

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
gornm565
Posts: 72
Joined: Tue Nov 15, 2016 6:11 pm

how to plugin python scripts in nagios xi ?

Post by gornm565 »

Our developers want an ability to run python scripts on a monitored server and have the script return data to nagios, so that nagios could monitor it and alert us in case it gets specific data from the python script. Any idea on how to implement it?

Thank you.
rkennedy
Posts: 6579
Joined: Mon Oct 05, 2015 11:45 am

Re: how to plugin python scripts in nagios xi ?

Post by rkennedy »

You will want to use check_by_ssh or check_nrpe to communicate from Nagios -> the client server, then, simply have your developers write their plugins using the guidelines here - https://assets.nagios.com/downloads/nag ... inapi.html - (more in depth here: https://nagios-plugins.org/doc/guidelines.html)

Basically, as long as they build the logic for the exit codes and echo the output, that's all that needs to be done. Nagios will interpret the exit codes accordingly.

For the check_by_ssh / NRPE side of things, see this document -
NRPE - https://assets.nagios.com/downloads/nag ... g_NRPE.pdf - https://support.nagios.com/kb/article.p ... ategory=22
check_by_ssh (uses SSH auth keys) - https://assets.nagios.com/downloads/nag ... ng_SSH.pdf
Former Nagios Employee
gornm565
Posts: 72
Joined: Tue Nov 15, 2016 6:11 pm

Re: how to plugin python scripts in nagios xi ?

Post by gornm565 »

Let's say our developer writes a script that checks something and returns 0 when things are good and 1 and 2 when things are bad. Where would that python script live? Would it execute on the client machine or on the nagios server itself? How would it pass that 0 or 1 to nagios?

We are running NSCLient++ on the Windows server that we want to monitor. So would the python script go onto that server? I can't seem to find the doc that describes these details.

Thanks.
ssax
Dreams In Code
Posts: 7682
Joined: Wed Feb 11, 2015 12:54 pm

Re: how to plugin python scripts in nagios xi ?

Post by ssax »

Please read through this documentation on how to work with external scripts in nsclient++:

http://docs.nsclient.org/howto/external_scripts.html

Then let us know if you have any questions.

Are you looking to do Active or Passive checks on that server?

https://assets.nagios.com/downloads/nag ... hecks.html
https://assets.nagios.com/downloads/nag ... hecks.html

Thank you
Locked