check_nt patch for units problem.
Alessandro Ren
alessandro.ren at opservices.com.br
Thu Feb 16 14:59:06 CET 2006
I've noticed that if you use check_nt for check a COUNTER like this
./check_nt -H HOST-v COUNTER -l "\\Memory\Pages/sec","%.1f pages/sec" -w
200 -c 400
17.0 pages/sec | '%.1f pages/sec'=17.000000%;200.000000;400.000000;
the returning metric has this %.1f that pollute the data and gets
showed in the graphics I generated, because perfparse storages it as the
metric value, but if a issue the same command without the %.1f, it would
return "No unit counter specified".
So, I've patched the check_nt so it runs without the %.1f and it
uses the description as metric. It returns as bellow, better in my opinion.
check_nt -H HOST -v COUNTER -l "\\Memory\Pages/sec","pages/sec" -w 200
-c 400
pages/sec = 28.00 pages/sec |
pages/sec=28.000000pages/sec;200.000000;400.000000;
it still works for normal % COUNTER checks, where it founds the % unit
in the description field.
check_nt -H HOST -v COUNTER -l "\\Paging File(_Total)\% usage","paging
file used" -w 95 -c 98
paging file used = 14.00 % | 'paging file
used'=14.000000%;95.000000;98.000000;
I am attaching the patch and I hope it does't break anything. I've
made some tests and everything seems to work fine.
I am attaching some graphics that generated by our capacity planning
module that show why I made this patch and the patch it self made
against nagios-plugins-1.4.2.
[]s.
--
__________________________________________________
*Alessandro Ren*
/*OpServices*/
/*Luciana de Abreu, 471 - Sala 403*/
/*Porto Alegre, RS - CEP 90570-060*/
*(* phone 55(51)3061-3588
*4* fax 55(51)3061-3588
*Q* mobile 55(51)8151-8212
*:* email alessandro.ren at opservices.com.br
<mailto:%22alessandro.ren at opservices.com.br%22>
__________________________________________________
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.monitoring-lists.org/archive/developers/attachments/20060216/ce0de394/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: counter-metric.diff.tar.gz
Type: application/gzip
Size: 1555 bytes
Desc: not available
URL: <https://www.monitoring-lists.org/archive/developers/attachments/20060216/ce0de394/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: graph1.png
Type: image/png
Size: 10065 bytes
Desc: not available
URL: <https://www.monitoring-lists.org/archive/developers/attachments/20060216/ce0de394/attachment.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: graph2.png
Type: image/png
Size: 9244 bytes
Desc: not available
URL: <https://www.monitoring-lists.org/archive/developers/attachments/20060216/ce0de394/attachment-0001.png>
More information about the Developers
mailing list