Nagiosgraph - custom map problem

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Locked
as300182
Posts: 36
Joined: Tue May 17, 2016 8:09 am

Nagiosgraph - custom map problem

Post by as300182 »

I've developed a custom script to check an application. The app has a built in check facility that looks at all sorts of things and reports back a page of useful info. So far my script reports back a simplified output and a bunch of perfdata that gives me details on how many users are active and all sorts of other things. The basic output is good enough for most people but now I'm being asked if I can make some of the perfdata available to the graph as well. I've managed to map the output quite successfully so I suppose I could move info from perfdata into the standard output, but that doesn't seem right to me. So I was wondering how I could get this into my graph without changing the custom script.

Currently I have:

Code: Select all

/output:.*([0-9]+\.?[0-9]+).* avg time. Idle (\d+), peak busy (\d+), avg usage (\d+)/
and push @s, [ sessions,
               [ 'avg idle',  GAUGE, $2 ],
               [ 'busy',  GAUGE, $3 ],
               [ 'avg use', GAUGE, $4 ]
 ];
Looking at other examples I thought I could use something like this to add:

Code: Select all

/perfdata:([.\d]+);([.\d]+);([.\d]+)/
and push @s, [ 'other',
               [ 'logged in', GAUGE, $1 ],
               [ 'top module',  GAUGE, $2 ],
               [ 'processes',  GAUGE, $3 ] 
               
];
So I extended my map as follows:

Code: Select all

/output:.*([0-9]+\.?[0-9]+).* avg time. Idle (\d+), peak busy (\d+), avg usage (\d+)/
and push @s, [ sessions,
               [ 'avg idle',  GAUGE, $2 ],
               [ 'busy',  GAUGE, $3 ],
               [ 'avg use', GAUGE, $4 ]
 ];

/perfdata:([.\d]+);([.\d]+);([.\d]+)/
and push @s, [ 'other',
               [ 'logged in', GAUGE, $1 ],
               [ 'modules',  GAUGE, $2 ],
               [ 'processes',  GAUGE, $3 ],
               [ 'connections',  GAUGE, $4 ] 
               
];
But I'm not sure if this is correct?

The above seems to work but I'm only seeing the first 6 on the graph page. So is there a limit that I've reached or do I need to change the format of the mapping definition please?
User avatar
mcapra
Posts: 3739
Joined: Thu May 05, 2016 3:54 pm

Re: Nagiosgraph - custom map problem

Post by mcapra »

nagiosgraph is unfortunately not a project we maintain, so the advice we can offer is a bit limited.

You might try reaching out to that community and seeing if they can offer suggestions:
https://sourceforge.net/p/nagiosgraph/discussion/394748

Have you verified that the data source contains the metrics you are attempting to add to the map file?
Former Nagios employee
https://www.mcapra.com/
as300182
Posts: 36
Joined: Tue May 17, 2016 8:09 am

Re: Nagiosgraph - custom map problem

Post by as300182 »

mcapra wrote:nagiosgraph is unfortunately not a project we maintain, so the advice we can offer is a bit limited.

You might try reaching out to that community and seeing if they can offer suggestions:
https://sourceforge.net/p/nagiosgraph/discussion/394748

Have you verified that the data source contains the metrics you are attempting to add to the map file?
I think I may have found the answer. I deleted the old rrd files and then restarted nagios. That seems to have fixed it.

Many thanks for the link to the nagiosgraph discussion board. Happy to close this one now.
Locked