Friday, 16 November 2012

Monitoring Windows System from Nagios

Install Nagios agent software NSClient++ on the system to be monitored. Edit NSC.ini file to specify the Nagios server / Collector's IP address under settings section as shown below

[Settings]
allowed_hosts=<nagios server ip>,localhost


Start / Restart NSClient++ Service from windows services management console

Run below command on collector's terminal to verify the communication between the agent and collector. If everything is OK the command should return agent version details as shown below.

/usr/local/groundwork/nagios/libexec/check_nrpe -H <monitored system IP>
I (0.3.9.328 2011-08-16) seem to be doing fine...


Once the above check is successful edit NSC.ini file to specify the required commands under "External Scripts" section for plugin execution as shown below \

check_test1=perl scripts\check_test1.pl -a "$ARG1$" -b "$ARG2$" -c "$ARG3$"
check_test2=perl scripts\check_test2.pl -a "$ARG1$" -b "$ARG2$" -c "$ARG3$" -d "$ARG4$"
check_test3=perl scripts\check_test3.pl -a "$ARG1$" -b "$ARG2$" -c "$ARG3$" -d "$ARG4$" -e "$ARG5$"


Replace test1, test2 and test3 names with the actual plugin names and copy those plugin scripts into C:\Program Files\NSClient++\scripts folder.

Restart NSClient++ service and check the command as shown below on collector

/usr/local/groundwork/nagios/libexec/check_nrpe -H <monitored system IP> -c check_test1 -a arg1!arg2!arg3

Configure all required services for this host by using groundwork's configuration tab.

Note: Make sure to install Perl for Windows on monitored host if perl plugins are used.

No comments:

Post a Comment