Nagios uses nsclient++ 's Check_nrpe way to monitor windows with custom scripts

Source: Internet
Author: User

Classification

nsclient++ to monitor Windows hosts in three ways: Check_nt, Check_nrpe, NSCA. Check_nt comes with a lot of features, but with poor extensibility, Check_nrpe can be extended well by executing scripts that you define (officially recommended).

Principle

The monitoring side sends the instructions to be monitored by check_nrpe to the monitored side, and the monitored side performs the monitoring tasks on the local computer and transmits the results of the execution back to the monitored side.

Realize

In nsclient++0.3, for example, the function of the example is to monitor whether a process is running.

1. Edit the nsclient configuration file Nsc.ini, and remove the ";" number in front of the following lines (remove the comment to make it effective)

Nrpelistener.dllscript_dir=scriptscheckexternalscripts.dll

2. Under the Scripts folder in the Nsclient installation directory, create a new check_run.bat batch file, as follows

File name: Check_run.bat

" %1 " >1010

3. In the Nsc.ini file, add the following line under [External Scripts]:

Check_run=scripts\check_run.bat   Chrome.exe

Note : [External scripts] instead of [External script]

4. Restart Nsclinet

5. The directory where the monitored end Check_nrpe is located (the CentOS default installation directory is:/usr/lib64/nagios/plugins/)

./check_nrpe-h hostip-c Check_run

Note :-H after the script just before the machine,-C after the write command, which corresponds to the Check_run in the configuration file

If the results are consistent with expectations, then you can continue to configure the monitoring side.

6. Configure the Monitor side

Modify Commands.cfg

Increase

Define Command {        command_name    check_fileexistspan        command_line    /usr/lib64/nagios/plugins/check_nrpe-h Yourip-c Check_fileexistspan        }

Modify Windows.cfg

Define Service {Use                     generic-service-urgent,srv-pnp        host_name               youip   ; IP service_ of the machine to display information        about Description     check_fileexistspan        check_command           check_run        }

Effect

Nagios uses nsclient++ 's Check_nrpe way to monitor windows with custom scripts

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.