Search Exchange
Search All Sites
Nagios Live Webinars
Let our experts show you how Nagios can help your organization.Login
Directory Tree
Directory
hiperesfera
byhiperesfera, January 20, 2012
Hi
first of all thanks so much for this plugin, great work!
I would like share with you something I have spotted as I have been using this plugin and always getting the same log output
[code] " TMM ulitization= 1 " [/code]
Having a look the script the function to round the variable I think it is not correct
[code]# Round to integer
$tmm_cpu = int($tmm_cpu + .5);[/code]
This is truncating the decimals with the int casting as you are only adding 0.5 and the number is in a range between 0 and 1, so I have changed it and now it is displaying fine:
[code]
# Round to integer
$tmm_cpu = int($tmm_cpu * 100); [/code]
just multiplying by 100 you get the percentage
[code] xxxx:/usr/local/nagios/libexec # ./check_f5_tmm.pl HOST STRING 76 90
OK: TMM utilization is 51 | pct=51
[/code]
hope it helps, thanks
first of all thanks so much for this plugin, great work!
I would like share with you something I have spotted as I have been using this plugin and always getting the same log output
[code] " TMM ulitization= 1 " [/code]
Having a look the script the function to round the variable I think it is not correct
[code]# Round to integer
$tmm_cpu = int($tmm_cpu + .5);[/code]
This is truncating the decimals with the int casting as you are only adding 0.5 and the number is in a range between 0 and 1, so I have changed it and now it is displaying fine:
[code]
# Round to integer
$tmm_cpu = int($tmm_cpu * 100); [/code]
just multiplying by 100 you get the percentage
[code] xxxx:/usr/local/nagios/libexec # ./check_f5_tmm.pl HOST STRING 76 90
OK: TMM utilization is 51 | pct=51
[/code]
hope it helps, thanks