How can i setup a monitor for an object on a site


#1

Hi, i would like to monitor some web pages using nagios. I know how to setup a monitor for an httpd service but don’t have a clue on how monitor a page.

Any help is appreciated.

Eg: google.com/intl/en/about.html.


#2

i just noticed that nagiosexchange.org has a plugin called check_http_content, let me try to download it.


#3

i have created an account at nagiosexchange.org, even if i am logged in, unable to download it. Can any direct me on downloading a single plugin.

Thanks.


#4

Yeah, I think something is wrong with that plugin page. Anyway there are few plugins of the same sort :
nagiosexchange.org/cgi-bin/p … 1.html;d=1
nagiosexchange.org/cgi-bin/p … 6.html;d=1


#5

Thank you very much for your help.

I have downloaded check_url.pl and put as a service but it seems not working… i think i am jumping it to high level without checking simple things first.

So i decided to configure a service check_ssh to monitor a remote server’s ssh

My configuation seems fine for the check_ssh, pre-flight goes fine. But i am receiving the following error messages in the log file and emails

[1224192495] SERVICE NOTIFICATION: nagiosadmin;test1.test1.com;SSH;CRITICAL;notify-service-by-email;CRITICAL - Socket timeout after 20 seconds

Any idea how to resolve this.

Note:
check_ssh test1.test1.com in a command line gives proper output.


#6

Pls, post the check_ssh command definition and service definition from your configuration.


#7

command definition

‘check_ssh’ command definition

define command{
command_name check_ssh
command_line $USER1$/check_ssh $ARG1$ $HOSTADDRESS$
}


host.cfg

define host{
host_name test1.test1.com ; The name of this host template
alias test1
address 10.10.10.10
use generic-host ; This template inherits other values from the generic-host template
check_period 24x7 ; By default, Linux hosts are checked round the clock
check_interval 1 ; Actively check the host every 5 minutes
retry_interval 1 ; Schedule host check retries at 1 minute intervals
max_check_attempts 10 ; Check each Linux host 10 times (ma:evil:

define service{
use local-service ; Name of service template to use
host_name test1.test1.com
service_description SSH
check_command check_ssh!-t 20!
check_period 24x7
check_interval 1
retry_interval 1
notification_options w,u,c,r,f
notification_interval 10
contact_groups unixadmins
notification_period 24x7
notifications_enabled 1
}


#8

You could try like this. In command definition:
command_line $USER1$/check_ssh -t $ARG1$ -H $HOSTADDRESS$

And in service definition:
check_command check_ssh!20!

I suppose you have defined $USER1$ correctly.


#9

thanks for your reply. Let me update it and reply.

Again…thank you very much


#10

I have checked the resource.cfg, i do see the following entry.

$USER1$=/opt/local/nagios/libexec


#11

Same error
[1224259528] SERVICE NOTIFICATION: nagiosadmin;test1.test1.com;SSH;CRITICAL;notify-service-by-email;CRITICAL - Socket timeout after 20 seconds


#12

When i am doing a manual check_ssh from the libexec directory, it is just fine.
bash-3.00# ./check_ssh -t 1 -H test1.test1.com
SSH OK - OpenSSH_5.0 (protocol 1.99)
bash-3.00#


#13

I am doing all stuff using the root user. Is it a requirement to use the “nagios” user when we are doing configuration ?


#14

This is working now.

Thank you very much Albin


#15

NP anair :slight_smile: