Nagiosgraph - custom map problem
Posted: Mon Apr 03, 2017 9:14 am
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:
Looking at other examples I thought I could use something like this to add:
So I extended my map as follows:
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?
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 ]
];Code: Select all
/perfdata:([.\d]+);([.\d]+);([.\d]+)/
and push @s, [ 'other',
[ 'logged in', GAUGE, $1 ],
[ 'top module', GAUGE, $2 ],
[ 'processes', GAUGE, $3 ]
];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 ]
];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?