Monitor disk via NSCA

Jim Avery jim at jimavery.me.uk
Fri Dec 10 17:48:14 CET 2010


On 7 December 2010 09:44, Rikard Dahlberg <ej_seg at hotmail.com> wrote:
> Hey all!
>
> I want to thank you all for the lovely help i got in my previous errand. It
> was NSCA that was missconfigured on one line, or more imporatly, one
> complete line was gone :) Now the NSCA passive checks work flawlessly,
> almost anyway.
> I can monitor CPU, memory and services, the only thing im getting problems
> with is hard-drive monitoring.
>
> These are the commands I've  chosen, but the disk command doesn't write
> anything out in nagios. Down below are a sample from nagios .cfg file also.
> From what i've read is that nagios treats the passive checks just as a
> normal queue as from a active check, so i believe i need a service for every
> host, as I would for a active check?
>
> Any idea what ive done wrong on the harddrive config?
>
> From NSClient:
> [NSCA Commands]
> CPU Load=alias_cpu
> host_check=check_ok
> Memory Usage=alias_mem
> Uptime=alias_up
> Drive space=alias_disk
> Service check=alias_service
>
> [External Alias]
> alias_cpu=checkCPU warn=80 crit=90 time=5m time=1m time=30s
> alias_cpu_ex=checkCPU warn=$ARG1$ crit=$ARG2$ time=5m time=1m time=30s
> alias_disk=CheckDriveSize MinWarn=10% MinCrit=5% CheckAll FilterType=FIXED
> alias_service=checkServiceState CheckAll
> alias_process=checkProcState $ARG1$=started
> alias_mem=checkMem MaxWarn=80% MaxCrit=90% ShowAll type=physical
> alias_up=checkUpTime MinWarn=1d MinWarn=1h
> alias_file_age=checkFile2 filter=out "file=$ARG1$" filter-written=>1d
> MaxWarn=1 MaxCrit=1 "syntax=%filename% %write%"
> alias_file_size=checkFile2 filter=out "file=$ARG1$" filter-size=>$ARG2$
> MaxWarn=1 MaxCrit=1 "syntax=%filename% %size%"
> alias_file_size_in_dir=checkFile2 filter=out pattern=*.txt "file=$ARG1$"
> filter-size=>$ARG2$ MaxWarn=1 MaxCrit=1 "syntax=%filename% %size%"
> alias_event_log_old=CheckEventLog file=application file=system filter=new
> filter=out MaxWarn=1 MaxCrit=1 filter-generated=>2d filter-severity==success
> filter-severity==informational truncate=800 unique descriptions
> "syntax=%severity%: %source%: %message% (%count%)"
> alias_event_log_new=CheckEventLog file=application file=system MaxWarn=1
> MaxCrit=1 "filter=generated gt -2d AND severity NOT IN ('success',
> 'informational')" truncate=800 unique descriptions "syntax=%severity%:
> %source%: %message% (%count%)"
> alias_event_log=alias_event_log_new
>
>
> From the host.cfg file from nagios
> define service{
>         use                     generic-service
>         host_name               ILSERVER
>         service_description     C:\ Drive Space
>         check_command           check_nt!USEDDISKSPACE!-l c -w 80 -c 90
>         }
>


The service_description in the Nagios service definition should match
the entry in your [nsca commands] section.  I would change the 's' in
'Drive space' to upper case to match your nagios service definition
and scrub the "C:\" so both now read 'Drive Space'.  The alias_disk
check tests all fixed disks so it's not strictly correct to have the
C:\ in the description.

The other problem is in your service definition you are using a
different kind of disk space check for the check_command.  It might
work, but would give weird results if it does both active and passive
checks.  You should either set it to query the same kind of check as
the passive one like this ..

         check_command           check_nrpe!-c alias_disk

or if the firewall prevents your Nagios server from doing active
checks, you should instead configure freshness checking to alert if
you haven't received a check recently.

Typically, for a passive service check like this you will want something like..

define service{
  use                     generic-service
  host_name               ILSERVER
  service_description   Drive Space
  check_freshness       1
  freshness_threshold   5400
  active_checks_enabled 0
  max_check_attempts    1
  check_command  check_dummy!3 "UNKNOWN: No passive check received
lately from the monitored host!"
}


Forgive me if I've missed anything. Although I do have a few passive
checks configured here, typically I only use them for servers which
are a right pain to log on to so I haven't double-checked all this is
100% correct!

hth,

Jim

------------------------------------------------------------------------------
Oracle to DB2 Conversion Guide: Learn learn about native support for PL/SQL,
new data types, scalar functions, improved concurrency, built-in packages, 
OCI, SQL*Plus, data movement tools, best practices and more.
http://p.sf.net/sfu/oracle-sfdev2dev 
_______________________________________________
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