Sounds like a bug. Not sure if the current CVS version has the fix.
jc
> -----Original Message-----
> From: Michael T. Halligan [mailto:michael@...]
> Sent: Thursday, January 30, 2003 9:37 PM
> To: Carroll, Jim P [Contractor]
> Cc: 'Ryan Cochrane'; nagios-users@...
> Subject: RE: [Nagios-users] problem with services file.
>
>
> = 1) I've never had any problems with using tabs in object
> definitions. If
> = anything, I make sure my config files have tabs. I'd be
> curious to know
> = what error Michael had (and the usual version of
> Nagios/platform/etc).
> = Regardless, if you prefer spaces, then use spaces.
>
> I realize now that the errors I have weren't with using tabs in
> object definitions per se, but when putting tabs in front of comments.
> When correcting this, removing that leading tab, there's no problem.
>
> So, if I have an entry in a file that says
> # This begins a definition
>
> upon an /etc/rc.d/init.d/nagios restart
>
> I'll receive this error :
>
> ---------------------------------------------
> service nagios
> Running configuration check...
> Nagios 1.0b6
> Copyright (c) 1999-2002 Ethan Galstad (nagios@...)
> Last Modified: 09-15-2002
> License: GPL
>
> Reading configuration data...
>
> Error: Unexpected token or statement in file
> '/etc/nagios/hosts.cfg' on line 2.
>
>
> ***> One or more problems was encountered while processing
> the config files...
>
> Check your configuration file(s) to ensure that they
> contain valid
> directives and data defintions. If you are upgrading
> from a previous
> version of Nagios, you should be aware that some
> variables/definitions
> may have been removed or modified in this version. Make
> sure to read
> the HTML documentation on the main and host config
> files, as well as the
> 'Whats New' section to find out what has changed.
>
> failed - aborting restart.
> ---------------------------------------------
>
>
> This is on a redhat 7.3 box, with all the latest errata,
> running the nagios 1.0b6 rpms, 2.4.18-4smp kernel.
>

To find out the particulars of seek/tell, do a "man perlfunc" and search for
"seek" or "tell". In a nutshell, 'tell' reports the current position that
perl has within a file, and 'seek' effectively moves you to that byte offset
in the file.
Instead of copying the entire logfile to a temporary location (which is what
check_log does), check_log2.pl will merely write the positional value (from
'tell') to a tempfile. Worst case scenario is that your seekfile will be
log(n) + 1 of the size of your logfile. E.g., if your /var/log/messages is
1,000,000 bytes long, then your seek file will be 7 bytes long.
This approach also has the advantage that you don't start each search from
the beginning of the file, doing a bytewise comparison of things which have
already been checked before.
Here's what I'm using in my nrpe.cfg (or at least, the relevant lines for my
Linux boxen - pardon the wordwrap):
command[linux_log_warn]=/home/nagios/libexec/check_log2 -l /var/log/messages
-s /home/nagios/.messages_warn.seek -p "WARN|Warn|warn|httpd.conf"
command[linux_log_err]=/home/nagios/libexec/check_log3 -l /var/log/messages
-s /home/nagios/.messages_err.seek -p "ERR|Err|err|PANIC|Panic|panic|File
system full" -n " nrpe| sshd|httpd.conf"
By now you're probably wondering a couple things. Allow me to jump ahead of
you:
1) "What happened to the .pl extension?"
I renamed the file. None of the other plugins show their extensions. If
you don't want to rename it, you shouldn't need to. Your choice.
2) "What's this check_log3 plugin?"
It's virtually an identical copy of check_log2. Here's a diff (explanation
to follow):
$ diff check_log2 check_log3
146c146
< exit $ERRORS{'WARNING'};
---
> exit $ERRORS{'CRITICAL'};
I effectively use check_log2 to report on 'warning' problems, and check_log3
to report on 'critical' problems. Ideally there would be a way to pass "-w"
and/or "-c" on the command line so that the appropriate return code is
evoked. I'm using a kludge, but it seems to do the trick.
HTH. Let me know if you're still having problems.
jc
> -----Original Message-----
> From: Daniel_Casey@... [mailto:Daniel_Casey@...]
> Sent: Friday, January 31, 2003 9:34 AM
> To: Carroll, Jim P [Contractor]
> Cc: nagios-users@...
> Subject: RE: [Nagios-users] check_log script errors
>
>
>
> I guess I'm not understanding how to use the script. I type:
>
> ./check_log2.pl -l /tmp/down.log -p Warning
>
> I get "Seek file not specified." What does the -s <seek file> do?
>
> I run this and it works:
>
> ./check_log2.pl -l /tmp/down.log -s /tmp/down.log.seek -p Warning
>
> Is the .seek file just a place-holder the script uses? I
> read the comments
> about
> using the .seek file to check size...is the seek file a copy
> of the logfile
> that you
> look at instead of the actual logfile?
>
> Thanks. again for the help! Script looks like it will work perfectly!
>
>

On Fri, 31 Jan 2003, [iso-8859-1] Fredrik W=E4nglund Fredrik.Wanglund-at-da=
tavis.se |Nagios| wrote:
> I changed the line=20
> #define DEFAULT_MIBLIST "ALL"
> to
> #define DEFAULT_MIBLIST "NONE"
> in check_snmp.c (the normal plugin) and recompiled. Now no mibs are
> loaded by default.
>=20
> The load on my server dropped from around 5-6 to 0-0.5!
I believe it! Defaulting to "ALL" is unwise, particularly on a
system which might have many MIBs in that directory. With all the MIBs I
have loaded an "snmpwalk -m all <host> public sysdescr" takes about 15-20s
of CPU-pegged time.
The plugin I'm using (a hacked-up version of the contrib script
check_snmp_disk_monitor.pl by Al Tobey) wisely only loads the two MIBs it
needs. (Al's original only loaded the one MIB it needed.)
My concern with caching has less to do with Nagios-side usage than with
spamming my WAN with unnecessary SNMP traffic. (I.e. why should I re-send
an SNMP request when I just made the same request 30s ago?)
It's looking a lot like I just need to persistently cache the data
received (and when) and only re-fetch if the data is stale.
-- Steve

Ok. Just for fun, I faked it using check_by_ssh.
In the service defintion:
event_handler reboot-remote-sillydaemon
Then in the checkcommand entry:
command_line command_line $USER1$/check_by_ssh -H $HOSTADDRESS$ -C
'/usr/local/nagios/eventhandlers/restart-sillydaemon $SERVICESTATE$
$STATETYPE$ $SERVICEATTEMPT$'
And that runs a typical eventhandler script, which looks for, in this case,
and UNKNOWN SOFT 2 state, then tries to restart the daemon in question.
The only thing is getting it to return something so the check_by_ssh doesn't
go 'critical - timeout' in ten seconds. But the daemon gets restarted, so
that's good enough.
-----Original Message-----
From: nagios-users-admin@...
[mailto:nagios-users-admin@...]On Behalf Of Shayne
Lebrun
Sent: Friday, January 31, 2003 1:34 PM
To: nagios-users@...
Subject: RE: [Nagios-users] attempt recovery on service CRITICAL with
nrpe
If only NRPE could pass arguments, I could do something like:
event_handler check_nrpe!restart-sillydaemon
Then in your command:
command
command_line /path/check_nrpe -H $HOSTADDRESS$ -c
restart-sillydaemon -ArgChain $SERVICESTATUS$!$STATETYPE$!$SERVICEATTEMPT$
Then in the nrpe.cfg on the remote host:
command[restart-sillydaemon]=/path/restart-sillydaemon $ARG1$ $ARG2$ $ARG3$
i.e. I just want the ArgChain, !-delimited, separated into ARGn variables,
which nrpe could then send along said arguments to the commands.
Ah well. If wishes were horses, then beggers would ride.
Consider it a feature request. :-)
Muskoka.com
115 Manitoba Street
Bracebridge, Ontario
P1L 2B6
(705)645-6097
Muskoka.com is pleased to announce
New High Speed Services
please visit
http://www.muskoka.com/services.htm
for more information
-------------------------------------------------------
This SF.NET email is sponsored by:
SourceForge Enterprise Edition + IBM + LinuxWorld = Something 2 See!
http://www.vasoftware.com
_______________________________________________
Nagios-users mailing list
Nagios-users@...
https://lists.sourceforge.net/lists/listinfo/nagios-users

If only NRPE could pass arguments, I could do something like:
event_handler check_nrpe!restart-sillydaemon
Then in your command:
command
command_line /path/check_nrpe -H $HOSTADDRESS$ -c
restart-sillydaemon -ArgChain $SERVICESTATUS$!$STATETYPE$!$SERVICEATTEMPT$
Then in the nrpe.cfg on the remote host:
command[restart-sillydaemon]=/path/restart-sillydaemon $ARG1$ $ARG2$ $ARG3$
i.e. I just want the ArgChain, !-delimited, separated into ARGn variables,
which nrpe could then send along said arguments to the commands.
Ah well. If wishes were horses, then beggers would ride.
Consider it a feature request. :-)
Muskoka.com
115 Manitoba Street
Bracebridge, Ontario
P1L 2B6
(705)645-6097
Muskoka.com is pleased to announce
New High Speed Services
please visit
http://www.muskoka.com/services.htm
for more information

I am new to Nagios, and recently got my configuration working. Upon
the initial set up I intentionally configured one of my hosts to NOT pass
the one of it's service checks. For some reason Nagios is reporting that
the results of the "check_smtp" plugin are "OK", even though "Connection
refused by host" is what is returned to the command line. When I originally
set this up, I received a "Critical" error (which is what I want), when the
check returned "Connection refused by host". I'm not sure why it is now
reporting that the status is "OK". I have not changed the parameters being
passed to "check_smtp", nor have I changed the version of the plugin. Can
anyone tell me what I might be doing wrong?
check_smtp Version info:
check_smtp (nagios-plugins 1.3.0-beta2) 1.8

Hello all,
I currently have 2 Nagios test boxes running, monitoring one test host
machine. The first box I made I made is not showing png,jpegs,or gif in
the statusmap or status summary cgi's, they are showing in the rest of
the cgi's. I have manipulated the hostextinfo.cfg, by making it as
minimal as possible (host_name,icon_image,statusmap_image), as well as
adding xedtemplate_config_file=/usr/local/nagios/etc/hostextinfo.cfg and
SetENV LD_LIBRARY_PATH /usr/local/lib in the httpd.conf file. In an
effort to trouble shoot I have made a 2nd test box, using the same
configurations, the only thing I did differently was use rpm's for the
gd,jpeg,jpeg-devel,zlib,zlib-devel,libpng,libpng-devel,gd-1.8.4 and
gd-1.8.4-devel.
This second box is not showing icons for any of the cgi's, I have
compared all of the configs, side by side and the only difference I
could find is, when I traced back to the SetENV line in the first box,
there were the libs for zlib,png,gd and jpeg, on the second box there
was nothing, but I did locate those same files in /usr/lib, so in an
attempt I changed the path for the SetENV line to include the path
/usr/lib..no luck.I have reviewed the lists, and with the help of you I
was able to get as far as I have, does anyone have any other hints,tips
or recommendations as to what I should look for? Thank you in advance.
Jay

I guess I'm not understanding how to use the script. I type:
./check_log2.pl -l /tmp/down.log -p Warning
I get "Seek file not specified." What does the -s <seek file> do?
I run this and it works:
./check_log2.pl -l /tmp/down.log -s /tmp/down.log.seek -p Warning
Is the .seek file just a place-holder the script uses? I read the comments
about
using the .seek file to check size...is the seek file a copy of the logfile
that you
look at instead of the actual logfile?
Thanks. again for the help! Script looks like it will work perfectly!

What about e-mail to a phone? Of course, if you mean no internet
connection at all, then e-mail would be out I guess.
Could Nagios use something like qpage? Then you could use a TAP service
IIRC, it's been a while. We use
e-mail now.
|---------+---------------------------------------->
| | David Corbin |
| | <dcorbin@...> |
| | Sent by: |
| | nagios-users-admin@...|
| | ceforge.net |
| | |
| | |
| | 01/31/2003 06:30 |
| | |
|---------+---------------------------------------->
>----------------------------------------------------------------------------------------------------------------------------------------------|
| |
| To: Nagios Users <nagios-users@...> |
| cc: |
| Subject: [Nagios-users] Alternative notifications |
>----------------------------------------------------------------------------------------------------------------------------------------------|
Is there a free package out there that I can use to send a Yahoo IM
message from the command line?
How about some way to send an SMS to a Cingular phone, without an
internet connection?
David
-------------------------------------------------------
This SF.NET email is sponsored by:
SourceForge Enterprise Edition + IBM + LinuxWorld = Something 2 See!
http://www.vasoftware.com
_______________________________________________
Nagios-users mailing list
Nagios-users@...
https://lists.sourceforge.net/lists/listinfo/nagios-users

I changed the line=20
#define DEFAULT_MIBLIST "ALL"
to
#define DEFAULT_MIBLIST "NONE"
in check_snmp.c (the normal plugin) and recompiled. Now no mibs are =
loaded by default.
The load on my server dropped from around 5-6 to 0-0.5!
/FredrikW
-----Original Message-----
From: Steve Bonds [mailto:r1p6os402@...]
Sent: Wed 29-Jan-03 21:51
To: nagios-users@...
Cc:=09
Subject: RE: [Nagios-users] Caching SNMP Info
On Wed, 29 Jan 2003, Carroll, Jim P [Contractor] =
jcarro10-at-sprintspectrum.com |Nagios| wrote:
> Not sure if this is what you're looking for, but on 12/20/2002 John P.
> Looney strongly endorsed the snmp proxy:
>=20
> http://freshmeat.net/releases/107146/
This really looked promising until the complete lack of documentation
killed it. There aren't even any useful comments in the source code to
describe what's going on.
It appears that the check_snmppd command was intended as a drop-in
replacement for check_snmp, but the proxy was not indended for general =
use
with random SNMP query scripts.
Still, an excellent tip, and if I get desperate enough to need it I can
go source-diving, document it myself, and maybe figure out how to
link it in with my NET-SNMP queries. ;-)
-- Steve
-------------------------------------------------------
This SF.NET email is sponsored by:
SourceForge Enterprise Edition + IBM + LinuxWorld =3D Something 2 See!
http://www.vasoftware.com
_______________________________________________
Nagios-users mailing list
Nagios-users@...
https://lists.sourceforge.net/lists/listinfo/nagios-users

I keep getting delivery failures for messages to the following addresses
(due to my mail setup):
pagenagios-admin@...
nagios-admin@...
jdoe@...
They're mentioned in the sample config files but don't exist at all in
my current setup. I've restarted nagios numerous times to no avail...
it's getting pretty annoying at this stage!! ;)
Where are these email messages being generated??
Regards
Donal
DCU