Nagios NSClient Agent Rollout Script

I'm a big fan of Nagios as a monitoring solution in environemnts large and small. The price can't be beat and the community around it is pretty good too. I have a zip attached to this post which contains a script I wrote to deploy the nsclient agent to a list of hosts specified in a text file.

The script requires two utilities from the Sysinternals PSTools package. There are two empty files in the zip named psexec.exe.goeshere and psservice.exe.goeshere. You should delete these and replace them with psexec and psservice from the Sysinternals site.

There is also a folder called DeployFolder in the zip . You need to download nsclient and place all the files in the archive inside of DeployFolder.

Your folder structure should look something like this once all the proper files are in place:



Finally, put the list of machine names in NagiosDeployList.txt one per line.

Run cscript NagiosDeploy.vbs to execute the script.

The script maps the B drive to do the work - you can change this at the top of the script if you have a B drive already. It drops the agent in c:\nagios on the target machines, this can be changed between lines 48 and 53.

The script sets the registry keys for port TCP1248 (nsclient default) and a connection password of "None" (nsclient default). These can be changed as well.

I commented the script pretty well, this shouldn't be hard to modify. I can't guarantee that it will work out of the box for you, I wrote it for a specific task, not to be a polished release product, but I figured why not share it?

This can be customized to roll out NRPE_NT pretty easily as well. I will probably end up baking a similiar script for rolling out updated nrpe_nt config and scripts/binaries.

UPDATE - Script download link: http://www.briandesmond.com/blog-attachments/nagiosrollout.zip

Posted Monday, August 07 2006 4:51 PM by Brian Desmond | 4 Comments
Tagged as: , ,

Comments, Trackbacks, & Pingbacks

#1 re: Nagios NSClient Agent Rollout Script

Wednesday, November 01 2006 6:21 AM by Saj Khan

excellent tool.

spelling mistake in your url link to the nagios webpage.

you've written: http://www,nagios.org/

keep up the good work!

Saj.

#2 re: Nagios NSClient Agent Rollout Script

Monday, September 22 2008 2:40 AM by Mutharasu

Hi,

i need the vbs script of Nagios NSClient Agent Rollout Script, but there is no zip file in this post. Could you tell me where can i get that code.

Thanks and Regards

Mutharasu

#3 re: Nagios NSClient Agent Rollout Script

Saturday, November 15 2008 9:39 PM by brian desmond

I fixed the typo and added the missing link.

#4 re: Nagios NSClient Agent Rollout Script

Saturday, February 14 2009 11:58 AM by Joseph L. Casale

Brian,

Have you had any luck getting this plugin deployed to Windows Server 2008 x64 clients? I get what seems to be a good deployment, yet none of these windows versions can report back to the Nagios server?

Leave a comment