Page 1 of 1

Run VBScript in passive monitoring

Posted: Wed Nov 22, 2017 11:52 am
by nentwich
I am new to the Nagios monitoring product and I need some assistance in this one task that I am trying to complete.

Due to some firewall constrains on our network we have a few Windows servers which need to use passive monitor as the Nagios server cannot connect to these servers. I have installed the NSClient++ client on the Windows box and configured the nsclient.ini file used NRDP protocol to send basic server telemetry data to the Nagios server. (ie. Memory usage, disk space, CPU). I can see this information on the Nagios website and in the log file I see the scheduler is obtaining this telemetry data every 5 minutes. I have found a few vbs scripts online which preform deeper checks on the services running on this Windows box. I would like the scheduler to kick off these vbscripts and push the results back to the Nagios server. In reading the documentation I cannot find a way to accomplish this task.

Any help with this problem would greatly be appropriated. Thanks in advance.

Joel

Re: Run VBScript in passive monitoring

Posted: Wed Nov 22, 2017 4:00 pm
by npolovenko
Hello, @nentwich. Check out this article: https://support.nagios.com/kb/article/n ... t-528.html Especially the section on Visual Basic Scripts. It'll walk you through a good example of how to set one up. Otherwise, please upload the VBS script you're trying to use so I can test it and give you a feedback.

Re: Run VBScript in passive monitoring

Posted: Fri Nov 24, 2017 1:43 pm
by nentwich
Thank you for the article but under the requirements it requires NRPE. My understanding, which could be wrong, is NRPE is active monitoring which requires the Nagios box to reach out to my windows server to have it executive it script. I need pastive way to run the script and return the results to the Nagios server. Firewalls are making it so the Nagios server cannot contact these windows servers.

Re: Run VBScript in passive monitoring

Posted: Mon Nov 27, 2017 3:59 pm
by npolovenko
@nentwich, Seems like you already have some basic checks configured over NRDP? https://assets.nagios.com/downloads/nag ... gLD_fD_BwE
Did you add the external script path in the [/settings/scheduler/schedules] section?

Re: Run VBScript in passive monitoring

Posted: Mon Nov 27, 2017 5:22 pm
by nentwich
@npolovenko, that is the problem that I am having I do not know how to add external scripts to the [/settings/scheduler/schedules]. Can you provide a few examples so I know what the syntax is?

Re: Run VBScript in passive monitoring

Posted: Tue Nov 28, 2017 10:00 am
by lmiltchev
Here's an example from one of my test boxes:

In nsclient.ini file, under the [/settings/scheduler/schedules] section I have:

Code: Select all

[/settings/scheduler/schedules]
os_version = check_os_version
Here, I want my check (that I see in Nagios XI web UI) to be called "os_version". The actual command is defined under the [/settings/external scripts/scripts] section:

Code: Select all

[/settings/external scripts/scripts]
check_os_version = script.exe //T:30 //NoLogo scripts\OS_Version.vb
Here's what I see under the "Service Status" page in Nagios XI:
example01.PNG
So, basically you could use the following syntax:

Code: Select all

[/settings/scheduler/schedules]
<service description> = <command name>
provided, the command is defined somewhere in nsclient.ini. It could be a script, an alias, etc.

Let us know if you have any more questions. Thanks!