[SOLVED] Starting with Nagios, monitorred site down

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.
Toontje
Posts: 11
Joined: Thu May 23, 2013 3:04 am

Re: Starting with Nagios, monitorred site down when it's not

Post by Toontje »

Code: Select all

root@eeepc:/usr/lib/nagios/plugins# ./check_ping -H  www.machielsen.net -w 200,50% -c 500,100%
PING OK - Packet loss = 0%, RTA = 48.79 ms|rta=48.789001ms;200.000000;500.000000;0.000000 pl=0%;50;100;0
sreinhardt
-fno-stack-protector
Posts: 4366
Joined: Mon Nov 19, 2012 12:10 pm

Re: Starting with Nagios, monitorred site down when it's not

Post by sreinhardt »

hmm, so check_ping seems to work great. So what is different with check-host-alive. Can you post the command definition for check-host-alive from your commands.cfg?
Nagios-Plugins maintainer exclusively, unless you have other C language bugs with open-source nagios projects, then I am happy to help! Please pm or use other communication to alert me to issues as I no longer track the forum.
Toontje
Posts: 11
Joined: Thu May 23, 2013 3:04 am

Re: Starting with Nagios, monitorred site down when it's not

Post by Toontje »

In commands.cfg

Code: Select all

################################################################################
# HOST CHECK COMMANDS
################################################################################

# On Debian, check-host-alive is being defined from within the
# nagios-plugins-basic package
I do have a check_host command in my plugins directory.

Code: Select all

ton@eeepc:/usr/lib/nagios/plugins$ ./check_host -H www.machielsen.net
OK - www.machielsen.net responds to ICMP. Packet 1, rta 48.110ms|pkt=1;;0;5 rta=48.110;1000.000;1000.000;;
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: Starting with Nagios, monitorred site down when it's not

Post by abrist »

Can we see the definition for:

Code: Select all

check-host-alive
And the definition that:

Code: Select all

check-host
uses if it differs from check-host-alive?
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
sreinhardt
-fno-stack-protector
Posts: 4366
Joined: Mon Nov 19, 2012 12:10 pm

Re: Starting with Nagios, monitorred site down when it's not

Post by sreinhardt »

I want to be sure that we are not mixing definitions here.

Plugin: an executable, script or some other item that nagios can directly interact with but is not exclusively a definition within a configuration.
Command: Specifically a defined name for something that nagios can execute, generally stored in commands.cfg in your nagios /etc directory. This is a definition that tells nagios how to interact and where to find a plugin to use.

So you have a check_host plugin that works, but via the debian\ubuntu commands.cfg file it seems that you need to install an additional package to get the base(per our standards) nagios definitions such as check-host-alive. Can you verify that you have installed nagios-plugins-basic?
Nagios-Plugins maintainer exclusively, unless you have other C language bugs with open-source nagios projects, then I am happy to help! Please pm or use other communication to alert me to issues as I no longer track the forum.
Toontje
Posts: 11
Joined: Thu May 23, 2013 3:04 am

Re: Starting with Nagios, monitorred site down when it's not

Post by Toontje »

Code: Select all

ton@eeepc:~$ dpkg -s nagios-plugins-basic
Package: nagios-plugins-basic
Status: install ok installed
Priority: extra
Section: net
Installed-Size: 1916
Maintainer: Ubuntu Developers <[email protected]>
Architecture: i386
Source: nagios-plugins
Version: 1.4.15-5ubuntu3
Replaces: nagios-plugins, nagios-plugins-extra (<= 1.3.1.0), nagios-plugins-standard
Depends: libc6 (>= 2.8), libssl1.0.0 (>= 1.0.0), procps, iputils-ping, ucf
Suggests: nagios3
Conflicts: nagios-plugins (<= 1.4.2-3), nagios-plugins-extra (<= 1.3.1.0)
Description: Plugins for nagios compatible monitoring systems
 Plugins for nagios compatible monitoring systems like Nagios and Icinga. It
 contains the following plugins:
 .
  check_apt, check_by_ssh, check_clamd, check_cluster,
  check_dhcp, check_disk, check_dummy, check_file_age,
  check_ftp, check_host, check_http, check_icmp,
  check_ide_smart, check_imap, check_ircd, check_jabber,
  check_load, check_log, check_mrtg, check_mrtgtraf,
  check_nagios, check_nntp, check_nntps, check_nt,
  check_ntp, check_ntp_peer, check_ntp_time, check_nwstat,
  check_overcr,  check_ping, check_pop, check_procs,
  check_real, check_rta_multi, check_sensors, check_simap,
  check_smtp, check_spop, check_ssh, check_ssmtp,
  check_swap, check_tcp, check_time, check_udp,
  check_ups, check_users
 .
 This package provides a basic set of plugins with minimal external
 dependencies.  It is not likely to be useful by itself unless you are
 using a remote "satellite" system (using nagios-nrpe-server, check_by_ssh or
 nsca, for example).
Homepage: http://nagiosplug.sourceforge.net
Original-Maintainer: Debian Nagios Maintainer Group <[email protected]>
Which makes all the sense in the world because, as i mentioned in my original post, only a few sites give me the Network Unreachable error. All sites are on the same hosting platform, so route from the Nagios server to the host, firewall rules on either side of the connection, hosting parameters, etc are all identical.
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: Starting with Nagios, monitorred site down when it's not

Post by abrist »

Nagios will still require that the check-host-alive be defined in a cfg *somewhere*. This is the command definition we want to see.
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
Toontje
Posts: 11
Joined: Thu May 23, 2013 3:04 am

Re: Starting with Nagios, monitorred site down when it's not

Post by Toontje »

abrist wrote:Nagios will still require that the check-host-alive be defined in a cfg *somewhere*. This is the command definition we want to see.
Ok, will do. However, why is it that not all websites give me the same error then?
And second, if the command doesn't exist, where does the "Network unreachable" status come from?
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: Starting with Nagios, monitorred site down when it's not

Post by abrist »

I believe the command does exist, I just want to check how it is configured as it could use a more obscure mechanism than standard ICMP.
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
Toontje
Posts: 11
Joined: Thu May 23, 2013 3:04 am

Re: Starting with Nagios, monitorred site down when it's not

Post by Toontje »

I found this in checkcommands.cfg

Code: Select all

define command{
        command_name                    check_host_alive
        command_line                    $USER1$/check_icmp -H $HOSTADDRESS$ -w 3000.0,80% -c 5000.0,100% -p 1
}
Locked