Nagios: How to Check if Remote Process or Services Is Running on Linux Machine
In this article, we configure how to add a service to monitoring on Linux Clients for demonstration purpose we are monitoring MySQL services. Basically, you only need to install NRPE to monitor services, processes, disk space, load, etc on your remote machine. For how to install the NRPE plugin, please click here
For my demo, I only need to check if a MySQL process is running and will use the check_procs.
NRPE and Nagios Plugins were installed and I can check the Nginx process locally using the following commands:
# /usr/local/nagios/libexec/check_procs -c 1:30 -C mysqld
If their process count is below 1 and above 30 this will send me a Critical notice.
If you want to add a Warning level you can use “-w 1:25” - adjust the number of processes for your needs. -C mysqld <– this will check for the command name (mysqld )
NOTE: For a complete reference on this check and other samples please refer to the NagiosWiki page.
Below are is the configurations:
On Client Side
# vi /usr/share/nagios /etc/nagios.cfg
# The following examples use hardcoded command arguments...
.
.
.
.
.
.
command[check_mysql]=/usr/local/nagios/libexec/check_procs -c 1:30 -C mysqld
Nagios server
Open the service configuration files and add the following at the end of the file.
# vi /usr/local/nagios /etc /services.cfg
host_name mydbserver
service_description MySQL Status
check_command check_nrpe! check_mysql
}
Nagios 4.1.1 other links
Installing Nagios Core 4.1.1 on Centos 6.7
Adding Nagios Linux host to Nagios core server
Adding Windows host to Nagios Core server
Adding MRTG to Nagios Core 4.1.1
Adding Nagios Graph to Nagios core 4.1.1
Keywords: Services, Nagios, Monitoring Remoter services, Remote services, Running status, Status of Services
Installing Nagios Core 4.1.1 on Centos 6.7
Adding Nagios Linux host to
Adding
Adding MRTG to Nagios Core 4.1.1
Adding Nagios Graph to Nagios core 4.1.1
Keywords: Services, Nagios, Monitoring Remoter services, Remote services, Running status, Status of Services
Comments
Post a Comment