Re: how to get trap massages about cpu usage using ssCpuRawSystem

Dave Shield <[email protected]>
Newsgroups gmane.network.net-snmp.user
Message-ID <CAKoMtGYLfbM0exzn25jsS6_a9eb8GU_sYj4DSGguWCS2zKJ3Yw@mail.gmail.com>
On 30 January 2012 04:41, Haiel Reder <[email protected]> wrote:
> im trying to get CPU usage in snmpd.conf while using the ssCPURawSystem MIB

What happens if you use 'snmpwalk' on this object?
Can you see the values you expect?

> view all included .iso.org.dod.internet.private.enterprises.ucdavis.systemStats

That shouldn't be necessary.
The "rouser" directive allows access to the full OID tree automatically.



> create user notifier

That doesn't look like a valid Net-SNMP config directive.
Please see the documentation


> rouser notifier

OK - user 'notifier' (once it's been created properly) should be able
to see everything


> trapcommunity public
> informsink 10.10.10.10

That looks OK too.
Are you seeing coldStart and nsShutdown traps when the agent starts and stops?



> monitor -i -u notifier -r 1 -o ssCpuRawSystem.0 -o "cpu usage"
>      .iso.org.dod.internet.private.enterprises.ucdavis.systemStats.cpuRawSystem.0 > 30

cpuRawSystem is a counter object so you need to be looking at the *differences*
between successive values.   Try adding the '-D' option to this line

It's not a percentage either - it's the number of ticks spent in that mode.
The threshold value would depend on the length of time between probes
(and querying every second may put a noticeable load on the system!)

  -o  specifies the OIDs to include in the resulting trap.
The object being monitored will be present anyway, so you don't need to mention
it explicitly.   And "cpu usage" is not a valid OID, so that option won't work.





> im not quite sure that this is how i get the percentage (because ssCpuSystem
> is deprecated) but i hope to get the right diraction

The MIB object ssCpuSystem has been deprecated, because the raw counter
version provides the same information in a more flexible form.   But it's still
present, and you can use that instead if you prefer.   (Note that this is *not*
a counter, so you wouldn't use '-D')

    There was an issue a while back with this reporting something different
depending on what O/S you were using  (which was the other reason for it
being deprecated).   But as long as you're using a reasonably recent
version of the agent, it should be consistent and useable.

Dave

------------------------------------------------------------------------------
Keep Your Developer Skills Current with LearnDevNow!
The most comprehensive online learning library for Microsoft developers
is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
Metro Style Apps, more. Free future releases when you subscribe now!
http://p.sf.net/sfu/learndevnow-d2d
_______________________________________________
Net-snmp-users mailing list
[email protected]
Please see the following page to unsubscribe or change other options:
https://lists.sourceforge.net/lists/listinfo/net-snmp-users
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.