Monitor a service running on a port other than 80 in Nagios

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Locked
ayogi
Posts: 1
Joined: Tue Aug 09, 2016 6:08 am

Monitor a service running on a port other than 80 in Nagios

Post by ayogi »

How do we monitor a remote service running on a machine using Nagios.
I have created a cfg file as follows:

define command {
command_name check_http
command_line /usr/lib64/nagios/plugins/check_http -H $HOSTADDRESS$ -p 8082
}

Now when I reload the configuration file, it throws following error:

Warning: Duplicate definition found for command 'check_http' (config file '/etc/nagios/servers/cfbase-prod.cfg', starting on line 19)
Error: Could not add object property in file '/etc/nagios/servers/cfbase-prod.cfg' on line 20.
Error processing object config files!

I am not able to figure out what is the problem.
Please help!
rkennedy
Posts: 6579
Joined: Mon Oct 05, 2015 11:45 am

Re: Monitor a service running on a port other than 80 in Nag

Post by rkennedy »

You'll want to change that command to check_http_8082 and then assign the command check_http_8082 to the service rather than check_http. For example -

Code: Select all

define command {
command_name check_http_8082
command_line /usr/lib64/nagios/plugins/check_http -H $HOSTADDRESS$ -p 8082
}
Former Nagios Employee
Locked