I have run the command as the user "Nagios" from the shell prompt, and
it works fine. But when called from Nagios, it fails.   In fact,
check_logs.pl is running perfectly on all of the Nagios client machines
without a problem.  The problem started when I wanted to monitor the
/var/log/messages file on the "Nagios server".  I'm having trouble
monitoring the local logs, but not logs from remote clients.

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:

11:59:13 nanosleep({0, 250000000}, 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, "<14>Aug 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]
[mailto:[EMAIL PROTECTED] On Behalf Of Jon
Angliss
Sent: Thursday, August 14, 2008 7:25 PM
To: nagios-users@lists.sourceforge.net
Subject: Re: [Nagios-users] Nagios fails to start after
adding'check_logs.pl' service

On Thu, 14 Aug 2008 09:10:19 -0600, "Bret Goodfellow"
<[EMAIL PROTECTED]> wrote:

>I have started monitoring the nagios server (local checks), and all has
>worked fine until I added a service to check the local logs.  When the
>'check_local_logs' service is added, the startup of Nagios fails after
>about 10 seconds.  I have also run 'strace' but am not sure how to
>interpret.    

[..]

>        command_line    $USER1$/check_logs.pl -c $ARG1$
>check_local_logs!/etc/nagios/check_logs_linux.cfg!

As well as Mark Powell's suggestions, try running the command as
nagios to see what happens to it.

  ./check_logs.pl -c /etc/nagios/check_logs_linux.cfg
-- 
Jon Angliss


------------------------------------------------------------------------
-
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=100&url=/
_______________________________________________
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

-------------------------------------------------------------------------
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=100&url=/
_______________________________________________
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

Reply via email to