Page 1 of 1

Call Custom SQL Script

Posted: Sun Mar 06, 2016 5:32 am
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?

Re: Call Custom SQL Script

Posted: Mon Mar 07, 2016 1:22 pm
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