Call Custom SQL Script

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
scunningham99
Posts: 1
Joined: Fri Feb 05, 2016 4:07 pm

Call Custom SQL Script

Post by scunningham99 »

HI

Please can someone tell me how to call a custom script? I need to call a custom script and return text values ?

for example

SQL> select release_name from fnd_product_groups:

returns 12.1.3.

I need to display the value?
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: Call Custom SQL Script

Post by lmiltchev »

You can use NSClient++ and Nagios XI to call a custom script. Place the script in the NSClient++ scripts' directory, define your command in the "nsclient.ini" file, restart NSClient++ service, and test your check from the command line.

Here's a simple example of defining a command in nsclient.ini, and calling the script from Nagios XI:

In "nsclient.ini"

Code: Select all

check_process_memory = cmd /c echo scripts\process_mem.ps1; exit $LastExitCode | powershell.exe -command -
In Nagios XI:

Code: Select all

[root@localhost ~]# /usr/local/nagios/libexec/check_nrpe -H x.x.x.x -c check_process_memory
0.62
Be sure to check out our Knowledgebase for helpful articles and solutions!
Locked