Run VBScript in passive monitoring

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
nentwich
Posts: 3
Joined: Wed Nov 22, 2017 11:08 am

Run VBScript in passive monitoring

Post 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
npolovenko
Support Tech
Posts: 3457
Joined: Mon May 15, 2017 5:00 pm

Re: Run VBScript in passive monitoring

Post 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.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
nentwich
Posts: 3
Joined: Wed Nov 22, 2017 11:08 am

Re: Run VBScript in passive monitoring

Post 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.
npolovenko
Support Tech
Posts: 3457
Joined: Mon May 15, 2017 5:00 pm

Re: Run VBScript in passive monitoring

Post 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?
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
nentwich
Posts: 3
Joined: Wed Nov 22, 2017 11:08 am

Re: Run VBScript in passive monitoring

Post 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?
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: Run VBScript in passive monitoring

Post 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!
You do not have the required permissions to view the files attached to this post.
Be sure to check out our Knowledgebase for helpful articles and solutions!
Locked