Trying to figure out the PCRE expression for Nagiosgraph Map

Claudio Kuenzler ck at claudiokuenzler.com
Fri May 10 23:11:42 CEST 2013


> The output for one query would be:
>
> PROCS OK: 11 processes with args 'apache'
>

Well first of all you'd have to make sure that nagiosgraph also takes the
output in account.
It's always better to do that with perfdata...

You have the choice to also take the output as source to parse, although I
strongly recommend to use perfdata. That's what it is for.


>
> What would the map rule look like that would do the following?
>
> 1. Begin with "PROCS OK:"
> 2. End with "args 'apache'"
> 3. Extract only the numeric value before the word processes?


The regex would look something like this:

/output:PROCS.*:(\d+) processes.*/

assuming that you don't care about the args and the status (OK, WARNING,
CRITICAL) part.
Only the digit (11) would be taken out of the output in this case.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.monitoring-lists.org/archive/users/attachments/20130510/1645b12d/attachment.html>
-------------- next part --------------
------------------------------------------------------------------------------
Learn Graph Databases - Download FREE O'Reilly Book
"Graph Databases" is the definitive new guide to graph databases and 
their applications. This 200-page book is written by three acclaimed 
leaders in the field. The early access version is available now. 
Download your free book today! http://p.sf.net/sfu/neotech_d2d_may
-------------- next part --------------
_______________________________________________
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