Page 1 of 1

check_tcp plugin not working

Posted: Tue Jun 16, 2015 12:03 pm
by Amit585731
All,

I am trying to monitor a tcp service (port 9100) on remote host but on nagios GUI host showing status pending. Any suggestion?

Below is the config I am using for same:

define hostgroup{
hostgroup_name Server
alias Server Check
members server5220
}


define host{
use generic-host
host_name server5220
alias Print Server
address 1.1.1.1
max_check_attempts 5
}


; monitoring tcp service

define service{
use generic-service ; Inherit values from a template
; hostgroup_name Server; The name of the host the service is associated with
service_description TCP Check ; The service description
check_command check_tcp!9100 ; The command used to monitor the service
normal_check_interval 5 ; Check the service every 5 minutes under normal conditions
retry_check_interval 1 ; Re-check the service every minute until its final/hard state is determined
}

Re: check_tcp plugin not working

Posted: Tue Jun 16, 2015 2:48 pm
by abrist
Does it have a next check time? If so, does that value keep getting bumped out?
Also, what version of core are you running?
If you are running core 4, can you post the output of:

Code: Select all

grep "auto_" /usr/local/nagios/etc/nagios.cfg

Re: check_tcp plugin not working

Posted: Tue Jun 16, 2015 10:12 pm
by Amit585731
host check attempt is 5 min. and I am using nagios 3.3.1

Re: check_tcp plugin not working

Posted: Tue Jun 16, 2015 10:48 pm
by Box293
Have a look in /usr/local/nagios/var/objects.cache and find the service. Post that here.

Re: check_tcp plugin not working

Posted: Wed Jun 17, 2015 8:16 am
by Amit585731
Abrist,

Here is the output I am seeing

auto_reschedule_checks=0
# has an effect if the auto_reschedule_checks option is enabled.
auto_rescheduling_interval=30
# only has an effect if the auto_reschedule_checks option is
auto_rescheduling_window=180

Re: check_tcp plugin not working

Posted: Wed Jun 17, 2015 8:18 am
by Amit585731
Box293,

Here is the output I am seeing:

Also in nagios GUI I am seeing services as 'No matching services'.

define command {
command_name check_tcp
command_line $USER1$/check_tcp -H $HOSTADDRESS$ -p $ARG1$ $ARG2$
}


host_name server5220
alias Server Check
address 1.1.1.1
notification_period 24x7
initial_state o
check_interval 5.000000
retry_interval 1.000000
max_check_attempts 2
active_checks_enabled 1
passive_checks_enabled 1
obsess_over_host 1
event_handler_enabled 1
low_flap_threshold 0.000000
high_flap_threshold 0.000000
flap_detection_enabled 1
flap_detection_options o,d,u
freshness_threshold 0
check_freshness 0
notification_options d,u,r,f,s
notifications_enabled 1
notification_interval 30.000000
first_notification_delay 0.000000
stalking_options n
process_perf_data 1
failure_prediction_enabled 1
retain_status_information 1
retain_nonstatus_information 1

Re: check_tcp plugin not working

Posted: Wed Jun 17, 2015 1:39 pm
by tgriep
Can you show us a screen shot of this?
Also in nagios GUI I am seeing services as 'No matching services'.
Also, it looks like you posted the host check instead of the service check from the objects.cache file. Can you post the service check again?