[Nagiosplug-help] Nagios SNMP help for CPU utilization

Patrick Proy nagios-user at proy.org
Mon Feb 14 16:00:23 CET 2005


Hi,

No, because you are calculating a percentage, not the cpu speed...
 
The sum off all the differences ((A2-A1)+(B2-B1)+(C2-C1)+(D2-D1) ) if equal
to N.
N is the number of ticks the CPU (including idle) has done in the time
interval between which you took the values.

So : (D2-D1)/N is the fraction part of the cpu used during this time
interval, and 100*(D2-D1)/N is in percentage.

No need to divide by time anywhere.

Patrick

-----Message d'origine-----
De : nagiosplug-help-admin at lists.sourceforge.net
[mailto:nagiosplug-help-admin at lists.sourceforge.net] De la part de Mohanty,
Amitabh (Corporate, consultant)
Envoyé : lundi 14 février 2005 23:47
À : Patrick Proy; nagiosplug-help at lists.sourceforge.net
Objet : RE: [Nagiosplug-help] Nagios SNMP help for CPU utilization

So if I need the average for 2 mins, I have to take the four values in 2
mins interval and divide the calculated value (as per the formula you have
given below) with 120. Please correct me if I am wrong.

Thanks,
Amitabh 

-----Original Message-----
From: Patrick Proy [mailto:nagios-user at proy.org]
Sent: Friday, February 11, 2005 10:56 AM
To: Mohanty, Amitabh (Corporate, consultant);
nagiosplug-help at lists.sourceforge.net
Subject: RE: [Nagiosplug-help] Nagios SNMP help for CPU utilization


OK, let's do a little math : 

At time T0, you query the four values A1,B1,C1,D1 for the four counters
(ssCpuRawUser, ssCpuRawNice, ssCpuRawSystem, ssCpuRawIdle) 

At T0 + N seconds, query A2,B2,C2,D2
Then to get the Idle% of the cpu (during those N seconds) : Idle % =
(D2-D1)*100/(A2+B2+C2+D2-A1-B1-C1-D1)

If you want instant value then N=5seconds : then you don't even have to
store the values.
Else N=300 seconds for 5 minutes average : you must store the values.

Patrick Proy
nagios AT proy.org 

-----Message d'origine-----
De : nagiosplug-help-admin at lists.sourceforge.net
[mailto:nagiosplug-help-admin at lists.sourceforge.net] De la part de Mohanty,
Amitabh (Corporate, consultant) Envoyé : vendredi 11 février 2005 16:33 À :
Patrick Proy; nagiosplug-help at lists.sourceforge.net
Objet : RE: [Nagiosplug-help] Nagios SNMP help for CPU utilization

Hi,
  I am sorry.. did not get you. Do I have to store subsequent values in two
variables values of snmpget and subtract?
Then what is the value I need to divide with the out put of subtraction?

 The OID I am using for is getting the CPU usage is an average one. For
example using the OID I get the average CPU idle value of 62%, but if I log
on to the server I get the CPU idle value of 90% idle and I get an alert on
Nagios as our warning threshold is 70% (if it falls below 70% it sends an
alert). Hope this make you understand. Please correct me if I am doing
anything wrong.
 Appreciate your help..

Thanks,
Amitabh
-----Original Message-----
From: Patrick Proy [mailto:nagios-user at proy.org]
Sent: Friday, February 11, 2005 10:22 AM
To: Mohanty, Amitabh (Corporate, consultant);
nagiosplug-help at lists.sourceforge.net
Subject: RE: [Nagiosplug-help] Nagios SNMP help for CPU utilization


That's easy : just store the counter values, make a substraction and divide
by all the values. You will need to write a script for this... 
Why do you need instant CPU BTW ?

Patrick
nagios AT proy.org




-----Message d'origine-----
De : nagiosplug-help-admin at lists.sourceforge.net
[mailto:nagiosplug-help-admin at lists.sourceforge.net] De la part de Mohanty,
Amitabh (Corporate, consultant) Envoyé : vendredi 11 février 2005 15:17 À :
Patrick Proy; nagiosplug-help at lists.sourceforge.net
Objet : RE: [Nagiosplug-help] Nagios SNMP help for CPU utilization

Hi Patrick,
  Thanks for your quick response. I think I can use snmpget (in linux)
instead and add that command in a shell script and call the script in
Nagios. But do you know how can I convert the counter values (ssCpuRawUser,
ssCpuRawNice, ssCpuRawSystem, ssCpuRawIdle) to the percentage of CPU
utilization?

Thanks,
Amitabh

-----Original Message-----
From: Patrick Proy [mailto:nagios-user at proy.org]
Sent: Friday, February 11, 2005 8:25 AM
To: Mohanty, Amitabh (Corporate, consultant);
nagiosplug-help at lists.sourceforge.net
Subject: RE: [Nagiosplug-help] Nagios SNMP help for CPU utilization


Hi,

If you want real-time value, you must get the counters (ssCpuRawUser,
ssCpuRawNice, ssCpuRawSystem, ssCpuRawIdle) instead.
But you won't be able to use check_snmp....

Patrick
nagios AT proy.org

-----Message d'origine-----
De : nagiosplug-help-admin at lists.sourceforge.net
[mailto:nagiosplug-help-admin at lists.sourceforge.net] De la part de Mohanty,
Amitabh (Corporate, consultant) Envoyé : jeudi 10 février 2005 17:24 À :
nagiosplug-help at lists.sourceforge.net
Objet : [Nagiosplug-help] Nagios SNMP help for CPU utilization

Hi,
  I am using Nagios snmp plugin (NetSNMP) for monitoring the cpu usage of
remote servers (Running Red Hat Linux). The output I am getting is the
average value  instead of the real-time value (i.e. output of the top
command). I am using the following command. 
  I would appreciate if someone can help me out on this.

./check_snmp -H <host_name> -C <community_name> -o
.1.3.6.1.4.1.2021.11.9.0,.1.3.6.1.4.1.2021.11.10.0,.1.3.6.1.4.1.2021.11.11.0

Thanks,
Amitabh Mohanty
GE - CIS (Corporate Communications)
Tel: 203-944-6411 Dialcomm: 8*233-6411
Mobile: 203-223-9200
Email: amitabh.mohanty at corporate.ge.com 



-------------------------------------------------------
SF email is sponsored by - The IT Product Guide Read honest & candid reviews
on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_ide95&alloc_id396&op=ick
_______________________________________________
Nagiosplug-help mailing list
Nagiosplug-help at lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nagiosplug-help
::: Please include plugins version (-v) and OS when reporting any issue. 
::: Messages without supporting info will risk being sent to /dev/null



-------------------------------------------------------
SF email is sponsored by - The IT Product Guide Read honest & candid reviews
on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_ide95&alloc_id396&op=ick
_______________________________________________
Nagiosplug-help mailing list
Nagiosplug-help at lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nagiosplug-help
::: Please include plugins version (-v) and OS when reporting any issue. 
::: Messages without supporting info will risk being sent to /dev/null



-------------------------------------------------------
SF email is sponsored by - The IT Product Guide Read honest & candid reviews
on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_ide95&alloc_id396&op=ick
_______________________________________________
Nagiosplug-help mailing list
Nagiosplug-help at lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nagiosplug-help
::: Please include plugins version (-v) and OS when reporting any issue. 
::: Messages without supporting info will risk being sent to /dev/null



-------------------------------------------------------
SF email is sponsored by - The IT Product Guide Read honest & candid reviews
on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_ide95&alloc_id396&op=ick
_______________________________________________
Nagiosplug-help mailing list
Nagiosplug-help at lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nagiosplug-help
::: Please include plugins version (-v) and OS when reporting any issue. 
::: Messages without supporting info will risk being sent to /dev/null





More information about the Help mailing list