Re: [Nagios-users] Nagios fails to start afteradding'check_logs.pl' service

2008-08-15 Thread Marc Powell


 -Original Message-
 From: [EMAIL PROTECTED] [mailto:nagios-users-
 [EMAIL PROTECTED] On Behalf Of Bret Goodfellow
 Sent: Friday, August 15, 2008 8:27 AM
 To: Jon Angliss; nagios-users@lists.sourceforge.net
 Subject: Re: [Nagios-users] Nagios fails to start
 afteradding'check_logs.pl' service


 My last post has output from strace.  I'm not sure how to read it,
but
 it appears to me that there may be a rights issue.  What does -1
ENOTTY
 (Inappropriate ioctl for device) mean?  Here again, are the last few
 lines from the strace:

Nothing to worry about in this case. Since you're not running the
command from a shell, NOTTY is expected.

 11:59:14 open(/usr/lib64/nagios/plugins/check_logs.pl, O_RDONLY) = 8
 11:59:14 ioctl(8, SNDCTL_TMR_TIMEBASE or TCGETS, 0x7fbfffa590) = -1
 ENOTTY (Inappropriate ioctl for device)
 11:59:14 lseek(8, 0, SEEK_CUR)  = 0
 11:59:14 fstat(8, {st_mode=S_IFREG|0755, st_size=6609, ...}) = 0
 11:59:14 fcntl(8, F_SETFD, FD_CLOEXEC)  = 0
 11:59:14 fstat(8, {st_mode=S_IFREG|0755, st_size=6609, ...}) = 0
 11:59:14 read(8, #!/usr/bin/perl -w\n#\n# Log file ..., 6609) = 6609
 11:59:14 close(8)   = 0
 11:59:14 --- SIGSEGV (Segmentation fault) @ 0 (0) ---

This is an interesting bit. The plugin is a perl program. Nagios loaded
it and would have been ready to execute it. Perl plugins could possibly
be treated 'specially' and have special requirements if you compile
Nagios with the embedded perl interpreter (ePN) enabled. Did you do so?
In the command{} definition for check_logs.pl, try disabling the use of
ePN by prefacing the command with your /path/to/perl --

(from memory)
define command {
command_name   check_logs ; or whatever it is
command_line   /path/to/perl $USER1$/check_logs.pl (... other stuff
here)
}

--
Marc


-
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK  win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100url=/
___
Nagios-users mailing list
Nagios-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nagios-users
::: Please include Nagios version, plugin version (-v) and OS when reporting 
any issue. 
::: Messages without supporting info will risk being sent to /dev/null


Re: [Nagios-users] Nagios fails to start afteradding'check_logs.pl' service

2008-08-14 Thread Bret Goodfellow

I decided to only test services for the host in question.  I wanted to make 
things simpler when looking at strace output.  So, nagios is only configured 
for one host, colorado.  Below is the output from strace:

11:59:10 nanosleep({0, 25000}, NULL) = 0
11:59:10 nanosleep({0, 25000}, NULL) = 0
11:59:11 open(/var/log/nagios/nagios.tmpmshZdK, O_RDWR|O_CREAT|O_EXCL, 0600) 
= 8
11:59:11 fcntl(8, F_GETFL)  = 0x8002 (flags O_RDWR|O_LARGEFILE)
11:59:11 fstat(8, {st_mode=S_IFREG|0600, st_size=0, ...}) = 0
11:59:11 mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 
0) = 0x2a95558000
11:59:11 lseek(8, 0, SEEK_CUR)  = 0
11:59:11 write(8, ..., 4096) = 4096
11:59:11 write(8, t_name=city\n\tmodified_attributes..., 4096) = 4096
11:59:11 write(8, andler=\n\thas_been_checked=1\n\tsho..., 4096) = 4096
11:59:11 write(8, eck_execution_time=0.008\n\tcheck_..., 4096) = 4096
11:59:11 write(8, pe=0\n\tcurrent_state=0\n\tlast_hard..., 4096) = 4096
11:59:11 write(8,  - Packet loss = 0%, RTA = 0.17 ..., 4096) = 4096
11:59:11 write(8, eck=1218581899\n\tnext_check=0\n\tcu..., 4096) = 4096
11:59:11 write(8, s=10\n\tstate_type=1\n\tlast_state_c..., 4096) = 4096
11:59:11 write(8, ution_time=0.004\n\tcheck_latency=..., 4096) = 4096
11:59:11 write(8, ss_performance_data=1\n\tobsess_ov..., 4096) = 4096
11:59:11 fchmod(8, 0664)= 0
11:59:11 write(8, _data=/oracle=6078MB;10280;11732..., 2764) = 2764
11:59:11 close(8)   = 0
11:59:11 munmap(0x2a95558000, 4096) = 0
11:59:11 rename(/var/log/nagios/nagios.tmpmshZdK, 
/var/log/nagios/status.dat) = 0
11:59:11 nanosleep({0, 25000}, NULL) = 0
11:59:11 nanosleep({0, 25000}, NULL) = 0
11:59:11 nanosleep({0, 25000}, NULL) = 0
11:59:11 nanosleep({0, 25000}, NULL) = 0
11:59:12 nanosleep({0, 25000}, NULL) = 0
11:59:12 nanosleep({0, 25000}, NULL) = 0
11:59:12 nanosleep({0, 25000}, NULL) = 0
11:59:12 nanosleep({0, 25000}, NULL) = 0
11:59:13 nanosleep({0, 25000}, NULL) = 0
11:59:13 nanosleep({0, 25000}, NULL) = 0
11:59:13 nanosleep({0, 25000}, NULL) = 0
11:59:13 nanosleep({0, 25000}, NULL) = 0
11:59:14 stat(/etc/localtime, {st_mode=S_IFREG|0644, st_size=877, ...}) = 0
11:59:14 open(/usr/lib64/nagios/plugins/check_logs.pl, O_RDONLY) = 8
11:59:14 fstat(8, {st_mode=S_IFREG|0755, st_size=6609, ...}) = 0
11:59:14 mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 
0) = 0x2a95558000
11:59:14 read(8, #!/usr/bin/perl -w\n#\n# Log file ..., 4096) = 4096
11:59:14 close(8)   = 0
11:59:14 munmap(0x2a95558000, 4096) = 0
11:59:14 stat(/usr/lib64/nagios/plugins/check_logs.pl, {st_mode=S_IFREG|0755, 
st_size=6609, ...}) = 0
11:59:14 open(/usr/lib64/nagios/plugins/check_logs.pl, O_RDONLY) = 8
11:59:14 ioctl(8, SNDCTL_TMR_TIMEBASE or TCGETS, 0x7fbfffa590) = -1 ENOTTY 
(Inappropriate ioctl for device)
11:59:14 lseek(8, 0, SEEK_CUR)  = 0
11:59:14 fstat(8, {st_mode=S_IFREG|0755, st_size=6609, ...}) = 0
11:59:14 fcntl(8, F_SETFD, FD_CLOEXEC)  = 0
11:59:14 fstat(8, {st_mode=S_IFREG|0755, st_size=6609, ...}) = 0
11:59:14 read(8, #!/usr/bin/perl -w\n#\n# Log file ..., 6609) = 6609
11:59:14 close(8)   = 0
11:59:14 --- SIGSEGV (Segmentation fault) @ 0 (0) ---
11:59:14 stat(/etc/localtime, {st_mode=S_IFREG|0644, st_size=877, ...}) = 0
11:59:14 stat(/etc/localtime, {st_mode=S_IFREG|0644, st_size=877, ...}) = 0
11:59:14 stat(/etc/localtime, {st_mode=S_IFREG|0644, st_size=877, ...}) = 0
11:59:14 sendto(3, 14Aug 14 11:59:14 nagios: Caug..., 61, MSG_NOSIGNAL, 
NULL, 0) = 61
11:59:14 open(/var/log/nagios/nagios.log, O_RDWR|O_CREAT|O_APPEND, 0666) = 8
11:59:14 fstat(8, {st_mode=S_IFREG|0664, st_size=165977, ...}) = 0
11:59:14 mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 
0) = 0x2a95558000
11:59:14 write(8, [1218736754] Caught SIGSEGV, shu..., 46) = 46
11:59:14 close(8)   = 0
11:59:14 munmap(0x2a95558000, 4096) = 0
11:59:14 rt_sigreturn(0x9)  = 105
11:59:14 --- SIGSEGV (Segmentation fault) @ 0 (0) ---
11:59:14 exit_group(-2) = ?
Process 24972 detached
[EMAIL PROTECTED] nagios]#

-Original Message-
From: [EMAIL PROTECTED] on behalf of Bret Goodfellow
Sent: Thu 8/14/2008 11:40 AM
To: Marc Powell; nagios List
Subject: Re: [Nagios-users] Nagios fails to start afteradding'check_logs.pl' 
service
 
Okay, I removed the trailing ! from the check_command statement.  I might 
also mention that the check_logs.pl works fine with all monitoring of remote 
systems.  I can also run check_logs.pl (as nagios) from the shell, and it works 
as well.  Here is the last part of the strace:

[pid 22473] lseek(4, 0, SEEK_CUR)   = 0
[pid 22473] read(4, -BEGIN DSA PRIVATE 
KEY-\nMIIDPgIBAAKCAQEAzTULry8dAYweYFywxOzvhLZTO9f3YZBTdahf3VineUduyBoX\n5denPMUjQslNq+twgkP5osLe6tXs6QY3J6DJy+TcqDsYDPMPJkpfmncEsdtQqG4a