help configuring nagios-mysql with nagiosgraph

John Stile john at stilen.com
Sat Oct 8 04:22:13 CEST 2005


On Wed, 2005-10-05 at 16:07 -0700, John Stile wrote: 
> On Tue, 2005-10-04 at 10:45 +1000, John Stevens wrote:
> > perfdata not recognized, usually means that the performance data
> > passed to nagiosgraph did not match any of the map file's definitions.
> > Read up on perl regexps and look at the map file.  It is pretty well
> > documented.  Then look at your output
> > 
> > On 10/4/05, John Stile <john at stilen.com> wrote:
> >         The rrd directory is world writable, but no databases are
> >         created.
> >         
> >         The nagiosgraph log shows 'perfdata not recognized'
> >                 Fri Sep 30 18:06:21 2005 INSERT info: Input lastcheck:
> >                 Fri Sep 30 18:06:21 2005 INSERT info: Input hostname: 
> >                 Fri Sep 30 18:06:21 2005 INSERT info: Input perfdata:
> >                 Fri Sep 30 18:06:21 2005 INSERT info: Input
> >         servicedescr:
> >                 Fri Sep 30 18:06:21 2005 INSERT info: Input output:
> >                 Fri Sep 30 18:06:21 2005 INSERT warn: perfdata not
> >         recognized  
> > This shows me that nagiosgraph is not receiving any information.
> > There is no data for lastcheck, hostname, perfdata, servicedescr, or
> > output.  In other words, at best, an empty line.  What is your
> > nagios.cfg file like?
> > You should have lines like this:
> > host_perfdata_command=process-host-perfdata
> > service_perfdata_command=process-service-perfdata
> > process_performance_data=1
> > in nagios.cfg, and
> > # 'process-service-perfdata' command definition
> > define command{
> >         command_name    process-service-perfdata
> >         command_line    /usr/local/bin/exec_perf "$HOSTNAME$"
> > "$SERVICEDESC$" "$SERVICESTATE$" "$OUTPUT$" "$PERFDATA$" "$LASTCHECK$"
> > }
> > in misccommands.cfg.  Sorry, I am not familiar with MySQL nagios
> > backend, but unless you have these set up, and you know what kind of
> > data is being passed to your process-service-data command, and the map
> > file recognises your performance data and how to handle it,
> > nagiosgraph will not produce rrds.  It is the process-service-perfdata
> > command that creates the rrds and updates them with new data.
> > 
> > Regards
> > Watching the logs, I never see an INSERT statement.  The logged INSERT
> > statement in my original email was because I ran insert.pl from the
> > console with no options, so that is why all the data is missing.
> 
> I'm stick stuck.  What seems insane usually is due to a type-o, but I really need some
> help on where to look next.
> 
> >From the ground up: 
> 1. Compile flags for the Debian-3.1 package nagios-common (nagios v1.3):
> ./configure --prefix=/usr \
>         --mandir=/usr/share/man \
>         --bindir=/usr/sbin \
>         --sbindir=/usr/lib/cgi-bin/nagios \
>         --datadir=/usr/share/nagios/htdocs \
>         --sysconfdir=/etc/nagios \
>         --infodir=/usr/share/info \
>         --libexecdir=/usr/lib/nagios/plugins \
>         --localstatedir=/var/log/nagios \
>         --with-ping-command="/bin/ping -n %s -c %d" \
>         --with-mail=/usr/bin/mail --with-perlcache \
>         --with-nagios-user=nagios \
>         --with-nagios-grp=nagios \
>         --with-template-objects \
>         --build=$(DEB_BUILD_GNU_TYPE) \
>         --host=$(DEB_HOST_GNU_TYPE) \
>         --with-pgsql-xdata \
>         --with-mysql-xdata \
>         --with-template-extinfo
> 
> 2. In /etc/nagios/nagios.conf: 
>   process_performance_data=1
>   service_perfdata_command=process-service-perfdata
> 
> 3. In /etc/nagios/misccommands.cfg 
> define command {
>   command_name  process-service-perfdata
>   command_line  /usr/share/nagios/nagiosgraph/insert.pl  "$HOSTNAME$" "$LASTCHECK$||$HOSTNAME$||$SERVICEDESC$||$OUTPUT$||$PERFDATA$"  >> /var/log/nagios/host-perfdata.out
> }
> 
> 4. Permissions on log files and rrd directory are 777, owned by nagios
> daemon user and apache daemon group.
> 
> 5. Nothing goes into /var/log/nagios/host-perfdata.out, no rrd databases
> are created.
> 
> So what does that tell me?  It appears to mean that perfdata is never
> sent to  process-service-perfdata command?
> 
> So do I load a bullet in the gun at this point?
> Is the problem that --with-template-extinfo was used and it must be
> --with-default-extinfo?  Are they are mutually exclusive?
SOLVED
  Debian-3.1 package nagios-common (v1.3) was not compiled with support
for a nagios.cfg option "service_perfdata_command="
  I didn't solve the problem in 'the Debian way' because rebuilding the
deb package didn't work for me (due to my level of expertise).
  I downloaded the source package, and ran configure with Debian-like
flags, then make and finally copied the binary to /usr/sbin/nagios.
After a restart, my  "service_perfdata_command=" directive started
working as it should.
  I wish I know the Debian package maintainer.

--------------------
The long version:
---------------------
NOTE: found perfparse faq, discussing how Debian package does has
perfdata turned off.  This FAQ was for an older package version.
    http://perfparse.sourceforge.net/faq.php
    See section: Q. I'm running Nagios on Debian Linux, and I can't get
Performance Data to work. I've tried everything, what could be my
problem?

# Default Nagios from Debian before changes:
nagios -m 
#      Nagios 1.3
#      Copyright (c) 1999-2004 Ethan Galstad (nagios at nagios.org)
#      Last Modified: 10-24-2004
#      License: GPL
#      
#      External Data I/O
#      -----------------
#      Object Data:      TEMPLATE
#      Status Data:      DATABASE (MySQL)
#      Retention Data:   DATABASE (MySQL)
#      Comment Data:     DATABASE (MySQL)
#      Downtime Data:    DATABASE (MySQL)
#      Performance Data: FILE
#      
#      Options
#      -------

# Fixing nagios
vi /etc/apt/sources.list
# deb-src http://ftp.us.debian.org/debian/ sarge  main
cd /tmp/
apt-get update
apt-get source nagios-mysql

cd ../nagios-1.3-cvs.20050402/
#    Compile flags are listed in debian/rules 

# Rebuild with proper options
# The only new option that matters is --with-default-perfdata
./configure --prefix=/usr/share/nagios \
    --prefix=/usr \
    --mandir=/usr/share/man \
    --bindir=/usr/sbin \
    --sbindir=/usr/lib/cgi-bin/nagios \
    --datadir=/usr/share/nagios/htdocs \
    --libexecdir=/usr/lib/nagios/plugins \
    --sysconfdir=/etc/nagios \
    --mandir=/usr/share/man \
    --infodir=/usr/share/info \
    --localstatedir=/var/log/nagios \
    --with-ping-command="/bin/ping -n %s -c %d" \
    --with-mail=/usr/bin/mail \
    --with-perlcache \
    --with-cgiurl=/nagios/cgi-bin \
    --with-htmurl=/nagios \
    --with-nagios-user=nagios \
    --with-nagios-grp=nagios \
    --with-default-perfdata \
    --with-mysql-downtime \
    --with-mysql-comments \
    --with-mysql-status \
    --with-mysql-retention \
    --with-mysql-extinfo

# backup old nagios
mv /usr/sbin/nagios /usr/sbin/nagios.debian

# keep a copy of my new nagios around, in-case an update blows it away
cp base/nagios /usr/sbin/nagios.john

# copy new nagios binary into place
cp /usr/sbin/nagios.john  /usr/sbin/nagios

# Not check what nagios says is running
nagios -m
#      Nagios 1.3
#      Copyright (c) 1999-2004 Ethan Galstad (nagios at nagios.org)
#      Last Modified: 10-24-2004
#      License: GPL
#
#      External Data I/O
#      -----------------
#      Object Data: TEMPLATE
#      Status Data: DATABASE (MySQL)
#      Retention Data: DATABASE (MySQL)
#      Comment Data: DATABASE (MySQL)
#      Downtime Data: DATABASE (MySQL)
#      Performance Data: DEFAULT
#
#      Options
#      -------

/etc/init.d/nagios restart
#    Now we have Data! YA!
  



-------------------------------------------------------
This SF.Net email is sponsored by:
Power Architecture Resource Center: Free content, downloads, discussions,
and more. http://solutions.newsforge.com/ibmarch.tmpl
_______________________________________________
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