nagiosgrapher and service_descriptions between Windows/UNIX

Matthew Angelo bangers at gmail.com
Fri Apr 8 08:54:18 CEST 2011


Hi team

Can someone please help me understand the way NagiosGrapher works (or
is meant to work) in relation to mapping the same service_description
name with different nrpe clients?

For example:

Windows Host:  WINSERV
CentOS Host:  LINUXSERV

Both have "Swap Usage" BUT because it's Windows vs UNIX -- the NRPE
clients return different graph_perf_regex and graph_log_regex strings.

#  check_nrpe -H LINUXSERV -c check_swap
SWAP OK - 100% free (4000 MB out of 4000 MB) |swap=4000MB;800;400;0;4000
# check_nrpe -H WINSERV -c check_swap
OK: virtual memory: 47.5M|'virtual memory %'=2%;90;95; 'virtual
memory'=47.45M;1843.08;1945.48;0;2047.87;


How do I account for this in my check_swap.ncfg?  The 'standard' one
that ships with ngraph works fine with UNIX, but I'm trying to add the
Windows NRPE string to also match and graph.

#---
#NagiosGrapherTemplateforcheck_swap
#---

##
##
## To support LINUX NRPE Clients
##
##
define ngraph{
        service_name            Swap Usage
        graph_log_regex         (\d+)%
        graph_value             swap
        graph_units             percent
        graph_legend            free swap space
        rrd_plottype            AREA
        rrd_color               00a000
        hide                    yes
        graph_uper_limit        100
}

define ngraph{
        service_name            Swap Usage
        type                    CDEF
        graph_value             swapdef
        graph_units             percent
        graph_legend            used swap space
        graph_calc
swap,UNKN,NE,swap,0,IF,100,LE,swap,100,IF,100,-,-1,*
        rrd_plottype            AREA
        rrd_color               a00000
}

##
##
## To Support Windows NRPE Clients
##
##

define ngraph{
        service_name            Swap Usage
        graph_perf_regex        virtual memory %=(\d+)%
        graph_value             swap_usage
        graph_units             %
        graph_legend            Swap Usage (percent)
        rrd_plottype            AREA
        rrd_color               a00000  # maroon
        graph_uper_limit        100
}


#[EOF]



2011-04-08 16:47:44 REGEX: 2 blocks for 'Swap Usage' found.
2011-04-08 16:47:44 REGEX: graph_value=swap
2011-04-08 16:47:44 REGEX: output=plugin.
2011-04-08 16:47:44 REGEX: regex=m/(\d+)%/i
2011-04-08 16:47:44 REGEX: perfdata=swap ok - 67% free (1358 mb out of 2047 mb)
2011-04-08 16:47:44 REGEX: match=67
2011-04-08 16:47:44 REGEX: graph_value=swap_usage
2011-04-08 16:47:44 REGEX: output=perfdata
2011-04-08 16:47:44 REGEX: regex=m/virtual memory %=(\d+)%/i
2011-04-08 16:47:44 REGEX: perfdata=swap=1358MB;409;204;0;2047
2011-04-08 16:47:44 REGEX: NO MATCH.

As you can see from my check_swap.ncfg, I added Windows support (which
doesn't work).  ngraph.log shows that it finds 2 "blocks"....but it
appears to only perform an "rrd update" *IF* ALL blocks match?  For
me, this will never be the case.  I expect only one block to match
(either the Windows block, or the UNIX block).

I have the regex and graphing working *IF* I give Windows a different
service_description ("Swap File Usage") but it doesn't feel right.
Trying to make them work "together" only appears to make it break.

Anyone have any tips/pointers?

Thanks!

------------------------------------------------------------------------------
Xperia(TM) PLAY
It's a major breakthrough. An authentic gaming
smartphone on the nation's most reliable network.
And it wants your games.
http://p.sf.net/sfu/verizon-sfdev
_______________________________________________
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