Nagios 1.2 & 1.4 Plugins - Need all the help I can get here


#1

Finally got Nagios 1.2 working but with a few problems.

  1. How do I get the two servers to be a member of any host groups!
  2. How do I once and for all resolve this pain? “Can’t locate Cache.pm in @INC

What are my options here?
I’ve been installing stuff on my Linux server and no joy…
This is getting rather frustrating…
After 2 weeks of installing and re-installing. I’m forever hitting a brick wall…

Consider this a continuation of another similar topic I started http://www.meulie.net/forum_viewtopic.php?21.232

**Trying to install the Plugins

Command: make check**

Can’t locate Cache.pm in @INC (@INC contains: … … /usr/lib/perl5/5.8.5/i586-linux-thread-multi /usr/lib/perl5/5.8.5 /usr/lib/perl5/site_perl/5.8.5/i586-linux-thread-multi /usr/lib/perl5/site_perl/5.8.5 /usr/lib/perl5/site_perl /usr/lib/perl5/vendor_perl/5.8.5/i586-linux-thread-multi /usr/lib/perl5/vendor_perl/5.8.5 /usr/lib/perl5/vendor_perl .) at ./t/check_imap.t line 4.
BEGIN failed–compilation aborted at ./t/check_imap.t line 4.
FAIL: t/check_imap.t
1…4

Running under perl version 5.008005 for linux

Current time local: Wed Feb 16 09:23:30 2005

Current time GMT: Wed Feb 16 09:23:30 2005

Using Test.pm version 1.25

ok 1
ok 2
ok 3
ok 4
PASS: t/check_load.t
Can’t locate Cache.pm in @INC (@INC contains: … … /usr/lib/perl5/5.8.5/i586-linux-thread-multi /usr/lib/perl5/5.8.5 /usr/lib/perl5/site_perl/5.8.5/i586-linux-thread-multi /usr/lib/perl5/site_perl/5.8.5 /usr/lib/perl5/site_perl /usr/lib/perl5/vendor_perl/5.8.5/i586-linux-thread-multi /usr/lib/perl5/vendor_perl/5.8.5 /usr/lib/perl5/vendor_perl .) at ./t/check_mysql.t line 5.
BEGIN failed–compilation aborted at ./t/check_mysql.t line 5.
FAIL: t/check_mysql.t
Can’t locate Cache.pm in @INC (@INC contains: … … /usr/lib/perl5/5.8.5/i586-linux-thread-multi /usr/lib/perl5/5.8.5 /usr/lib/perl5/site_perl/5.8.5/i586-linux-thread-multi /usr/lib/perl5/site_perl/5.8.5 /usr/lib/perl5/site_perl /usr/lib/perl5/vendor_perl/5.8.5/i586-linux-thread-multi /usr/lib/perl5/vendor_perl/5.8.5 /usr/lib/perl5/vendor_perl .) at ./t/check_ping.t line 4.

FAIL: t/check_vsz.t

18 of 20 tests failed

make[2]: *** [check-TESTS] Error 1
make[2]: Leaving directory /home/michael/nagios-plugins-1.4/plugins' make[1]: *** [check-am] Error 2 make[1]: Leaving directory/home/michael/nagios-plugins-1.4/plugins’
make: *** [check-recursive] Error 1

**Running Nagios 1.2 after compiling the Plugins

Command: /usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg**

Nagios 1.2
Copyright © 1999-2004 Ethan Galstad (nagios@nagios.org)
Last Modified: 02-02-2004
License: GPL

Reading configuration data…

Running pre-flight check on configuration data…

Checking services…
Checked 15 services.
Checking hosts…
Warning: Host ‘Barney’ is not a member of any host groups!
Warning: Host ‘Duckula’ is not a member of any host groups!
Checked 3 hosts.
Checking host groups…
Checked 1 host groups.
Checking contacts…
Checked 1 contacts.
Checking contact groups…
Checked 1 contact groups.
Checking service escalations…
Checked 0 service escalations.
Checking host group escalations…
Checked 0 host group escalations.
Checking service dependencies…
Checked 0 service dependencies.
Checking host escalations…
Checked 0 host escalations.
Checking host dependencies…
Checked 0 host dependencies.
Checking commands…
Checked 8 commands.
Checking time periods…
Checked 1 time periods.
Checking for circular paths between hosts…
Checking for circular service execution dependencies…
Checking global event handlers…
Checking obsessive compulsive service processor command…
Checking misc settings…

Total Warnings: 2
Total Errors: 0

Things look okay - No serious problems were detected during the pre-flight check
MrBurns:/home/michael/nagios-plugins-1.4 # /usr/local/nagios/bin/nagios /usr/local/nagios/etc/nagios.cfg

Nagios 1.2
Copyright © 1999-2004 Ethan Galstad (nagios@nagios.org)
Last Modified: 02-02-2004
License: GPL

Nagios 1.2 starting… (PID=6386)
Warning: Host ‘Barney’ is not a member of any host groups!
Warning: Host ‘Duckula’ is not a member of any host groups!
sh: /usr/local/nagios/libexec/check_load: No such file or directory
Warning: Return code of 127 for check of service ‘Current Load’ on host ‘Barney’ was out of bounds. Make sure the plugin you’re trying to run actually exists.
sh: /usr/local/nagios/libexec/check_load: No such file or directory

:x
Edited ]


#2

I’d ignore the make check not working…
and have a look at the hostgroup definition in the docs. :slight_smile: but this should do it. I have somthing like this in the main CFG file we are using

define hostgroup {
hostgroup_name myservergroup
alias Another Name for the group
contact_groups admins
members Barney,Duckula
}


#3

Thanks for that Luca

I am using minimal.cfg and configured just one server to start with.

What does this mean thou?.. :roll: **(Return code of 127 is out of bounds - plugin may be missing)

[16-02-2005 10:10:42] Warning: Return code of 127 for check of service ‘Current Users’ on host ‘Barney’ was out of bounds. Make sure the plugin you’re trying to run actually exists. **

Host Service Status Last Check Duration Attempt Status Information
Barney
Current Load
CRITICAL 16-02-2005 09:23:05 0d 3h 21m 54s 4/4 (Return code of 127 is out of bounds - plugin may be missing)
Current Users
CRITICAL 16-02-2005 09:24:05 0d 3h 20m 54s 4/4 (Return code of 127 is out of bounds - plugin may be missing)
PING
CRITICAL 16-02-2005 09:25:05 0d 3h 19m 54s 4/4 (Return code of 127 is out of bounds - plugin may be missing)
Root Partition
CRITICAL 16-02-2005 09:22:53 0d 3h 18m 54s 4/4 (Return code of 127 is out of bounds - plugin may be missing)
Total Processes
CRITICAL 16-02-2005 09:22:53 0d 3h 13m 39s 4/4 (Return code of 127 is out of bounds - plugin may be missing)
Edited Wed Feb 16 2005, 05:40PM ]


#4

what check are you making?
you are missing the correct plugin in the libexec directory.
Possibily check_snmp (had that the other day… ) hasn0t compiled because NET-SNMP itself is not installed on the nagios machine.

Luca


#5

Just for the record. I had to install the following before the plugins would work at all.
**

  1. First of all. Before installing nagios-plugins-1.3.0.tar.gz. I had to install krb5-libs-1.2.7-14.i386.rpm which has the library files that the plugin depends on.

  2. Then installed nagios-plugins-1.3.0.tar.gz. I figured chances are that the 1.4 plugin was also incomplete like the rest of the Nagios builds

By this time, I was happy to see the damn thing working.

  1. Now to upgrade the Plugins by installing nagios-plugins-1.4.tar.gz
    **
    The only issue I have at the moment is that the ping section of the plugin is not working for some reason.

The following error is reported in the log file

** Warning: Attempting to execute the command “/bin/check_ping -H 192.169.1.138 -w 99,99% -c 100,100% -p 1” resulted in a return code of 127. Make sure the script or binary you are trying to execute actually exists… **

Can anyone suggest a fix please.

Thanks Luca & jakkedup for your support guys :slight_smile:


#6

why is it looking in /bin/check_ping ?
is that your correct plugin directory?
it’s usually in $nagios_install_dir$/libexec

Luca

PS: warning and critical values should be a timeout and a loss percentage separated by the comma…
Something like -w 500.0,20% -c 1000.0,40% would be better suited (depending on what you are pinging and how “far away” it is).
Edited Fri Feb 18 2005, 03:40PM ]


#7

I really can’t see where the plugin config is refering check_ping path from.


#8

in checkcommands you should have a reference between the command itself and how its passed to the system (usually theres a $USER1$ variable)

$USER1$ is referenced in resources.cfg on my installation… and tells NAGIOS the path to the plugins directory

Luca


#9

resource.cfg

Sets $USER1$ to be the path to the plugins

$USER1$=/usr/local/nagios/libexec

And it’s still refering to /bin/check_ping.
I can see check_ping in the /use/local/nagios/libexec folder

Warning: Attempting to execute the command “/bin/check_ping -H 192.169.1.3 -w 99,99% -c 100,100% -p 1” resulted in a return code of 127. Make sure the script or binary you are trying to execute actually exists…

:frowning:
Edited Fri Feb 18 2005, 04:45PM ]


#10

how is it referenced in checkcommands.cfg?
maybe it’s pointing explicitly to /bin/check_ping instead of $USER1$/check_ping…


#11

Here is the first instance of it towards the top of the same file

**# This command checks to see if a host is “alive” by pinging it

The check must result in a 100% packet loss or 5 second (5000ms) round trip

average time to produce a critical error.

Note: Only one ICMP echo packet is sent (determined by the ‘-p 1’ argument)

‘check-host-alive’ command definition

define command{
command_name check-host-alive

command_line $USER1$/check_ping -H $HOSTADDRESS$ -w 3000.0,80% -c 5000.0,100% -p 1

   command_line    $USER1$/check_ping -H $HOSTADDRESS$ -w 99,99% -c 100,100% -p 1
   }

**

Here is the second instance placed at the bottom

# ‘check-host-alive’ command definition
define command{
command_name check-host-alive
command_line $USER1$/check_ping -H $HOSTADDRESS$ -w 3000.0,80% -c 5000.0,100% -p 1
}

Edited Fri Feb 18 2005, 05:04PM ]


#12

why is it defined twice?

i have once check_ping:

‘check_ping’ command definition

define command{
command_name check_ping
command_line $USER1$/check_ping -H $HOSTADDRESS$ -w $ARG1$ -c $ARG2$
-p 6
}

and once check_host_alive:

‘check-host-alive’ command definition

define command{
command_name check-host-alive
command_line $USER1$/check_ping -H $HOSTADDRESS$ -w 3000.0,80% -c 500
0.0,100% -p 1
}

check ping has some parameters more but it doesn’t change much. :slight_smile:

Still strange it goes to the /bin directory…
What happens if you copy check_ping to the /bin directory? (it’s no solution but maybe you have it working in the meanwhile)

Luca


#13

OK, now I’m getting confused here. I was working with you in another thread and now I see 2 or 3 more from you. Which leads me to believe that you are good to go, in regards to your first post about trouble. But I actually don’t know for sure, since you have all these other problems.

I’d be glad to help, but communication is a 2 way thing and I never heard back in your first thread, whether or not things are ok.
If you are having trouble with check_ping using /bin/check_ping, it’s because you have a config file stating that is what the command is. For example:
minimal.cfg should have an entry of
define command{
command_name check_ping
command_line $USER1$/check_ping -H $HOSTADDRESS$ -w $ARG1$ -c $ARG2$ -p 5
}
or maybe the above definition is in checkcommands.cfg
Also, like luca stated, resource.cfg may have USER1 set to /bin

This is what is in the “out of the box” minimal.cfg-sample file that comes with the nagios-2.0b2 and is most likely your problem.

Command to check to see if a host is “alive” (up) by pinging it

define command{
command_name check-host-alive
command_line /bin/check_ping -H $HOSTADDRESS$ -w 99,99% -c 100,100% -p 1
}

So if you used this sample, then you are going to have trouble, which is what I stated in your other thread. I have the new beta nagios working, and there are a few of these kind’s of buggy items.

It might be nice if we all adopt a policy of “one thread, one problem, one resolution”, and not start up a new thread and new problem, until you have closed your other one. In other words, it doesn’t take much to confuse me, so maybe this is just my problem, and I should just shut my trap. hehe, oh well, I’m done ranting.


#14

[quote=“jakkedup”][size=67]OK, now I’m getting confused here. I was working with you in another thread and now I see 2 or 3 more from you. Which leads me to believe that you are good to go, in regards to your first post about trouble. But I actually don’t know for sure, since you have all these other problems.

I’d be glad to help, but communication is a 2 way thing and I never heard back in your first thread, whether or not things are ok.
If you are having trouble with check_ping using /bin/check_ping, it’s because you have a config file stating that is what the command is. For example:
minimal.cfg should have an entry of
define command{
command_name check_ping
command_line $USER1$/check_ping -H $HOSTADDRESS$ -w $ARG1$ -c $ARG2$ -p 5
}
or maybe the above definition is in checkcommands.cfg
Also, like luca stated, resource.cfg may have USER1 set to /bin

This is what is in the “out of the box” minimal.cfg-sample file that comes with the nagios-2.0b2 and is most likely your problem.

Command to check to see if a host is “alive” (up) by pinging it

define command{
command_name check-host-alive
command_line /bin/check_ping -H $HOSTADDRESS$ -w 99,99% -c 100,100% -p 1
}

So if you used this sample, then you are going to have trouble, which is what I stated in your other thread. I have the new beta nagios working, and there are a few of these kind’s of buggy items.

It might be nice if we all adopt a policy of “one thread, one problem, one resolution”, and not start up a new thread and new problem, until you have closed your other one. In other words, it doesn’t take much to confuse me, so maybe this is just my problem, and I should just shut my trap. hehe, oh well, I’m done ranting.[/size] [/quote]

**
Yes jakkedup - I found it.
However, the event log is telling me **

[quote=“Event Log”][size=67][18-02-2005 14:37:44] HOST NOTIFICATION: nagios-admin;Barney;DOWN;host-notify-by-email;CRITICAL - Plugin timed out after 10 seconds

[18-02-2005 14:34:54] HOST NOTIFICATION: nagios-admin;Barney;DOWN;host-notify-by-email;CRITICAL - Plugin timed out after 10 seconds

[18-02-2005 14:33:54] HOST NOTIFICATION: nagios-admin;Barney;DOWN;host-notify-by-email;CRITICAL - Plugin timed out after 10 seconds

[18-02-2005 14:32:44] HOST NOTIFICATION: nagios-admin;Barney;DOWN;host-notify-by-email;CRITICAL - Plugin timed out after 10 seconds

[18-02-2005 14:30:04] HOST NOTIFICATION: nagios-admin;Barney;DOWN;host-notify-by-email;CRITICAL - Plugin timed out after 10 seconds

[18-02-2005 14:29:04] HOST NOTIFICATION: nagios-admin;Barney;DOWN;host-notify-by-email;CRITICAL - Plugin timed out after 10 seconds

[18-02-2005 14:27:44] HOST NOTIFICATION: nagios-admin;Barney;DOWN;host-notify-by-email;CRITICAL - Plugin timed out after 10 seconds

[18-02-2005 14:24:54] HOST NOTIFICATION: nagios-admin;Barney;DOWN;host-notify-by-email;CRITICAL - Plugin timed out after 10 seconds

[18-02-2005 14:23:54] HOST NOTIFICATION: nagios-admin;Barney;DOWN;host-notify-by-email;CRITICAL - Plugin timed out after 10 seconds

[18-02-2005 14:22:44] HOST NOTIFICATION: nagios-admin;Barney;DOWN;host-notify-by-email;CRITICAL - Plugin timed out after 10 seconds

[18-02-2005 14:20:04] HOST NOTIFICATION: nagios-admin;Barney;DOWN;host-notify-by-email;CRITICAL - Plugin timed out after 10 seconds

[18-02-2005 14:19:04] HOST NOTIFICATION: nagios-admin;Barney;DOWN;host-notify-by-email;CRITICAL - Plugin timed out after 10 seconds

[18-02-2005 14:17:45] HOST NOTIFICATION: nagios-admin;Barney;DOWN;host-notify-by-email;CRITICAL - Plugin timed out after 10 seconds

[18-02-2005 14:14:54] HOST NOTIFICATION: nagios-admin;Barney;DOWN;host-notify-by-email;CRITICAL - Plugin timed out after 10 seconds

[18-02-2005 14:13:54] HOST NOTIFICATION: nagios-admin;Barney;DOWN;host-notify-by-email;CRITICAL - Plugin timed out after 10 seconds

[18-02-2005 14:12:44] HOST NOTIFICATION: nagios-admin;Barney;DOWN;host-notify-by-email;CRITICAL - Plugin timed out after 10 seconds

[18-02-2005 14:09:54] HOST NOTIFICATION: nagios-admin;Barney;DOWN;host-notify-by-email;CRITICAL - Plugin timed out after 10 seconds

[18-02-2005 14:08:54] HOST NOTIFICATION: nagios-admin;Barney;DOWN;host-notify-by-email;CRITICAL - Plugin timed out after 10 seconds

[18-02-2005 14:07:44] HOST NOTIFICATION: nagios-admin;Barney;DOWN;host-notify-by-email;CRITICAL - Plugin timed out after 10 seconds

[18-02-2005 14:04:54] HOST NOTIFICATION: nagios-admin;Barney;DOWN;host-notify-by-email;CRITICAL - Plugin timed out after 10 seconds

[18-02-2005 14:03:54] HOST NOTIFICATION: nagios-admin;Barney;DOWN;host-notify-by-email;CRITICAL - Plugin timed out after 10 seconds

[18-02-2005 14:02:44] HOST NOTIFICATION: nagios-admin;Barney;DOWN;host-notify-by-email;CRITICAL - Plugin timed out after 10 seconds[/size] [/quote]

[quote=“Service Detail”][size=67]PING
CRITICAL 18-02-2005 14:37:44 2d 7h 54m 28s 1/50 CRITICAL - Plugin timed out after 10 seconds[/size] [/quote]

Why is this such a slow process? I can ping directly from the this machine successfully.

:?
Edited Sun Feb 20 2005, 06:56PM ]


#15

what is a slow process? Please, don’t rely on us knowing what you are talking about. Please state your trouble, and we will work through it with you.
If you are talking about “why is my ping timing out”, that is a signal that the check is not getting any response at all.
Try running the command by logging in as nagios, and running the check just like nagios would.
/usr/local/nagios/libexec/check_ping -H 127.0.0.1 -w 200,20% -c 300,30% -p 5


#16

BTW, what did you find when you said “Yes, I found it”? Do you mean you fixed the problem with the /bin/ping? You see, that’s what I mean, we can’t just around on problems so much. One problem at a time, I’ll aready running on 13 brain cells only, due to the 70’s, so…hehe


#17

Yes I ment that I had fixed the problem and it was what you mentioned in your post.

Entering the command as you mentioned works fine. But it’s timing out from Nagios itself.

[quote=" 0%, RTA = 0.25 ms
]

And this also works for pinging other network servers.
Edited Mon Feb 21 2005, 04:59PM ][/quote]