No perf-definition for service.

Tedman Eng teng at dataway.com
Fri Oct 17 06:57:30 CEST 2003


The check-command definition for apan.sh is called with:
apan.sh $ARG1$ $HOSTNAME$ "$SERVICEDESC$" $TIMET$ $ARG2$ $ARG3$
These correspond to:
CHECK=$1   HOST=$2   SVCNAME=$3   TIME=$4   WARN=$5   CRIT=$6

(CHECK must be one of:
disk,nt-net,nt-disk,nt-smtp,nt-load,load,ping,lxk_pages,snmpget,disk_by_snmp
)
1. "check_local_disk" is the $CHECK command that apan will try to use.
There's a CASE statement in apan.sh which looks for this service keyword.
"check_local_disk" is not in the stock APAN, so either change it to "disk"
or edit apan.sh to include "check_local_disk"

(SERVICEDESC to nagios is the SVCNAME to apan)
2. Remove the spaces in the service description, don't use 'questionable'
characters (stuff that _might_ mess up shell text-parsing utils, / \ @ $ % ;
etc..)
3. Make it match the second field of your apan.cfg line.

(I'm assuming you're checking Unix disks)
4. Your service.cfg and apan.cfg entries are NT-style.  Revise them to
Unix-style. (see the apan how-to's)
5.  The RRD files are NT-style.  Revise them to Unix-style. (see the apan
how-to's)

Here's the relevant changes
-------------------------------------------------
#service.cfg
 define service{
         use                             generic-service
         host_name                       nagios-server
         service_description             Disk-usage
         is_volatile                     0
         check_period                    24x7
         contact_groups                  squarebox-support
         notification_options            c,w,r
         check_command            apan!disk!50!75

# apan.cfg
nagios-server;Disk-usage;/usr/local/nagios/rrd/nagios-server-disk-usage.rrd;
/|/boot;root:AREA boot:STACK;Disk usage;%;

# Create an RRD file
rrdtool create /usr/local/nagios/rrd/nagios-server-disk-usage.rrd -s 60
DS:root:GAUGE:300:0:U DS:boot:GAUGE:300:0:U RRA:AVERAGE:0.5:1:50400
RRA:AVERAGE:0.5:60:43800

Hope this helps!
--TE

"Tom Welsh" <twelsh at square-box.com> wrote in message news:000301c39331$da750
ad0$0400a8c0 at squarebox.com...
> Hi All,
>
> I've just installed apan for the first time and I keep getting the above
> error.
>
> As far as I can see I have configured it correctly. I get the following
> output in /tmp/apan.debug
>
> #Output from apan.debug
> Wed Oct 15 16:23:30 BST 2003 Args: check_local_disk nagios-server / Free
> Space 1066231410 /dev/hda3
> Wed Oct 15 16:23:30 BST 2003 Args: check_local_disk nagios-server /boot
> Free Space 1066231410 /dev/hda1
> Could not insert '' , '' into
> Could not insert '' , '' into
> Below are my configuration commands I used.
>
> 1. #apan.def
> # Path to rrdtool
> RRDTOOL=/usr/local/rrdtool/bin/rrdtool
>
> 2. #checkcommnd.cfg
> #'apan' command definition. Runs apan on selected commands
> define command {
>         command_name                   apan
>         command_line                   /usr/local/nagios/apan/apan.sh
> $ARG1$ $HOSTNAME$ "$SERVICEDESC$" $TIMET$ $ARG2$ $ARG3$
>         }
>
> 3. #services.cfg
> # Service definition for checking free disk space on /boot
> define service{
>         use                             generic-service
>         host_name                       nagios-server
>         service_description             /boot Free Space
>         is_volatile                     0
>         check_period                    24x7
>         contact_groups                  squarebox-support
>         notification_options            c,w,r
>         check_command
> apan!check_local_disk!"/dev/hda1"
>   }
>
> 4. #apan.cfg
> #nagios-server Disk Usage
> nagios-server;check_local_disk;/usr/local/nagios/rrd/nagios-server-disk-
> usage.rrd;root|boot;root-used:AREA root-free:STACK boot-used:AREA
> boot-free:STACK;Disk usage;Bytes;-l 1 -b 1024
>
> 5. #Create an RRD file
> pod-163:/usr/local/nagios/etc# /usr/local/rrdtool/bin/rrdtool create
> rrd/nagios-server-disk-usage.rrd -s 60 DS:root-used:GAUGE:900:0:U
> DS:root-free:GAUGE:900:0:U DS:boot-used:GAUGE:900:0:U
> DS:boot-free:GAUGE:900:0:U RRA:AVERAGE:0.5:1:50400
> RRA:AVERAGE:0.5:60:43800
>
> 6. #Extended service info
> #'nagios-server' extended service info
> define serviceextinfo{
>         host_name               nagios-server
>         service_description     Disk-usage
>         notes_url
> /nagios/cgi-bin/apan.cgi?host=nagios-server&service=Disk-usage
>         icon_image              graph.png
>         icon_image_alt          View graphs
>                 }
>
> 7. #Output from apan.debug
> Wed Oct 15 16:23:30 BST 2003 Args: check_local_disk nagios-server / Free
> Space 1066231410 /dev/hda3
> Wed Oct 15 16:23:30 BST 2003 Args: check_local_disk nagios-server /boot
> Free Space 1066231410 /dev/hda1
> Could not insert '' , '' into
> Could not insert '' , '' into
>
> Any one spot a mistake im making.
>
> All help greatfully received
>
> Cheers
>
> Tom Welsh
> twelsh at square-box.com
>
>
>
>
> DISCLAIMER: This e-mail contains proprietary information some or all of
> which may be legally privileged. It is for the intended recipient only.
> If an addressing or transmission error has misdirected this e-mail,
> please notify the author by replying to this e-mail. If you are not the
> intended recipient you must not use, disclose, distribute, copy, print,
> or rely on this e-mail.
>
> Sender accepts no liability for any damage resulting from the use and/or
> acceptation of the content of this e-mail.
>
> Always scan attachments before opening them.
>
> The views expressed in this communication may not necessarily be the
> views held by squareBOX technologies ltd
>
>
>
>
>
> -------------------------------------------------------
> This SF.net email is sponsored by: SF.net Giveback Program.
> SourceForge.net hosts over 70,000 Open Source Projects.
> See the people who have HELPED US provide better services:
> Click here: http://sourceforge.net/supporters.php
> _______________________________________________
> 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
>





-------------------------------------------------------
This SF.net email is sponsored by: SF.net Giveback Program.
SourceForge.net hosts over 70,000 Open Source Projects.
See the people who have HELPED US provide better services:
Click here: http://sourceforge.net/supporters.php
_______________________________________________
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