Very basic configuration questions

Ralph.Grothe at itdz-berlin.de Ralph.Grothe at itdz-berlin.de
Mon Jul 18 15:51:51 CEST 2005


Hello Pete,

I surrounded the $USER5$ value by single quotes and sent the
nagios pid a sighup.

$ grep ^\$USER5 resource.cfg
$USER5$='itdz-berlin.de'

nagios understood the signal as intended, as it seems

$ tail -2 /var/opt/nagios/log/nagios.log 
[1121692649] SERVICE EVENT HANDLER:
neptun;check-host-neptun;OK;SOFT;3;notify-by-email
[1121692735] Caught SIGHUP, restarting...

Is there a test program from the nagios installed tools that
could be used to deliberately raise an event
in order to test if notifications work properly?
Or do I have to provoke an event (e.g. filling a filesystem for a
check_disk monitor)?

For now I cannot use the cgi interface because my http server
setting seems a little broken.
I wonder where it got the wrong path for the ScriptAlias from?

$ tail -1 /var/opt/nagios/log/www_nagdaisy_error.log |sed
's/\(.*\[client \).*\(\].*\)/\1\2/'
[Mon Jul 18 15:44:19 2005] [error] [client ] attempt to invoke
directory as script: /opt/sw/nagios/sbin

The CGIs went here during installation.

$ ll /opt/sw/nagios/sbin/
total 5648
-rwxrwxr-x   1 nagios   nagios    214901 Jun 20 14:31 avail.cgi
-rwxrwxr-x   1 nagios   nagios    214033 Jun 20 14:31 cmd.cgi
-rwxrwxr-x   1 nagios   nagios    172201 Jun 20 14:31 config.cgi
-rwxrwxr-x   1 nagios   nagios    234106 Jun 20 14:31 extinfo.cgi
-rwxrwxr-x   1 nagios   nagios    178502 Jun 20 14:31
histogram.cgi
-rwxrwxr-x   1 nagios   nagios    151461 Jun 20 14:31 history.cgi
-rwxrwxr-x   1 nagios   nagios    148525 Jun 20 14:31
notifications.cgi
-rwxrwxr-x   1 nagios   nagios    149357 Jun 20 14:31 outages.cgi
-rwxrwxr-x   1 nagios   nagios    146489 Jun 20 14:31 showlog.cgi
-rwxrwxr-x   1 nagios   nagios    220574 Jun 20 14:31 status.cgi
-rwxrwxr-x   1 nagios   nagios    178047 Jun 20 14:31
statusmap.cgi
-rwxrwxr-x   1 nagios   nagios    165489 Jun 20 14:31
statuswml.cgi
-rwxrwxr-x   1 nagios   nagios    152752 Jun 20 14:31
statuswrl.cgi
-rwxrwxr-x   1 nagios   nagios    177341 Jun 20 14:31 summary.cgi
-rwxrwxr-x   1 nagios   nagios    164868 Jun 20 14:31 tac.cgi
-rwxrwxr-x   1 nagios   nagios    185863 Jun 20 14:31 trends.cgi


A little deviating from the usual webserver config as outlined in
the Nagios docs I'm using here
a virtual host configuration why I omitted the suggested nagios
subdir from ServerRoot (no need for such distinction for a
virtual host) and defined the below


$ sed -n '/^# grothe/,$p' /usr/HTTPServer/conf/httpd.conf|sed -n
/ScriptAlias/,\$p|grep -v Allow\ From
 From
    ScriptAlias         /cgi-bin /opt/sw/nagios/sbin
    <Directory /opt/sw/nagios/sbin>
        Options         None
        AllowOverride   AuthConfig
        Order           allow,deny
    </Directory>
</VirtualHost>


It looks like I need to substitute the href attributes in the
anchors of the starting Nagios screen to get the CGIs properly
invoked.
Yes, a Nagios newbie shouldn't deviate from the standard
procedures ;-)


> -----Original Message-----
> From: Pete Dewell [mailto:pete at stuff-done.co.uk]
> Sent: Monday, July 18, 2005 2:44 PM
> To: Ralph.Grothe at itdz-berlin.de
> Cc: nagios-users at lists.sourceforge.net
> Subject: Re: [Nagios-users] Very basic configuration questions
> 
> 
> Try defining the $USER$ variable as
> 
> $USER5$='our.site.tld'
> 
> I found that using single quotes stops a lot of substitution
errors.
> 
> As for restarting Nagios, there is a "restart" option on the
web 
> interface, under "process info". I'm not sure whether it uses 
> HUP, but 
> it seems to do the job.
> 
> Pete Dewell
> 
> Ralph.Grothe at itdz-berlin.de wrote:
> > Hi,
> > 
> > I newly subscribed to this list.
> > So forgive if these kind of embryonic questions already have
been
> > asked and answered a 1000 times.
> > I'm a bit too impatient to dig through the FAQs and list
archives
> > right now.
> > I will do this later.
> > 
> > I tweaked my set of config files so long until nagios
pre-flight
> > check didn't report errors
> > but only warnings anymore.
> > 
> > The warnings are due to many predefined hosts that I haven't
had
> > the time to elaborate on required service checks yet.
> > 
> > So I started nagios in daemon mode (i.e. -d), and having had
the
> > first 6 nodes monitored (i.e. mere check_icmp so far) for the
> > lunch break.
> > 
> > Of course I couldn't expect everything to work from the
> > beginning.
> > 
> > So I noticed a couple of errors when I turned my eye on
nagios
> > log and nagios user's mail queue.
> > 
> > First there's a minute macro expansion problem.
> > 
> > Among others I defined this MX domain
> > 
> > $ grep ^\$USER5 /opt/sw/nagios/etc/resource.cfg
> > $USER5$=our.site.tld
> > 
> > $ grep resource.cfg /opt/sw/nagios/etc/nagios.cfg
> > resource_file=/opt/sw/nagios/etc/resource.cfg
> > 
> > $ cat -n /opt/sw/nagios/etc/contacts.cfg | sed -n 15,23p
> >     15
> >     16  define contact {
> >     17      use
generic-contact
> >     18      contact_name                        grothe
> >     19      alias                               Ralph Grothe
SAZ
> >     20  #                                       see
resource.cfg
> > for $USER5$
> >     21      email
> > ralph.grothe@$USER5$
> >     22  }
> >     23
> > 
> > This is what happened.
> > The MTA bounced the notification on an check_icmp alert
because
> > there was some queer substitution,
> > recipient rewriting going on.
> > 
> > 
> > $ grep -E Final-Recipient\|Diagnostic-Code
/var/spool/mail/nagios
> > 
> > Final-Recipient: rfc822; ralph.grothe at USER5.other.site.tld
> > Diagnostic-Code: X-Postfix; Name service error for
> > name=user5.other.site.tld
> > 
> > 
> > Why didn't the macro get substituted?
> > Did the MTA rewrite the other.site.tld as suffix, or where
could
> > have come from?
> > (n.b. {our,other}.site.tld are merely dummies for real
addresses
> > for I feared being spammed)
> > 
> > Another question,
> > if I extend or adapt my Nagios config do I have to bring the
the
> > daemon down,
> > or would a 
> > 
> > $ kill -HUP $(cat /var/opt/nagios/nagios.pid)
> > 
> > suffice?
> > 
> > Thanks
> > 
> > 
> > -------------------------------------------------------
> > SF.Net email is sponsored by: Discover Easy Linux Migration 
> Strategies
> > from IBM. Find simple to follow Roadmaps, straightforward
articles,
> > informative Webcasts and more! Get everything you need to get
up to
> > speed, fast.
http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click
> > _______________________________________________
> > Nagios-users mailing list
> > Nagios-users at 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
> 
> -- 
> Pete Dewell | Stuff Done
> pete at stuff-done.co.uk
> 
> 
> ** The information contained in this message, including any 
> attachment,
> is confidential and may be privileged or otherwise protected
from
> disclosure. The information is intended only for the person 
> or entity to
> which it is addressed. If you are not the intended recipient,
please
> contact the sender and delete this message from your system. 
> Any review,
> re-transmission, distribution or other use of this information
by
> persons or entities other than the intended recipient is
prohibited. *
> 


-------------------------------------------------------
SF.Net email is sponsored by: Discover Easy Linux Migration Strategies
from IBM. Find simple to follow Roadmaps, straightforward articles,
informative Webcasts and more! Get everything you need to get up to
speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click
_______________________________________________
Nagios-users mailing list
Nagios-users at 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





More information about the Users mailing list