Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
837 views
in Technique[技术] by (71.8m points)

mib - Definition of SNMP Gauge32 vs Counter32

Can someone point me to a good definition of Gauge32 vs Counter32? I understand that Counter32 can wrap, but Gauge32 can't.

I'm trying to understand their semantics. For example, I've heard you should take the difference between two Counter32 readings to get a value/second. Is there something like that for a Gauge32 value?

Thanks for any insight.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

The best definition of these (i.e. the definition) is in the sections of the RFC that defines them: RFC 2578.

As the RFC says, a Counter32 has no defined initial value, so a single reading of Counter32 has no information content. This is why you have to take two (or more) readings to make sense of it. An example of this would be the number of packets received on an ethernet interface. If you take a reading and get back 4 million packets, you haven't learned anything: the wire could have been pulled out of the interface for the past year, or it could be passing millions of packets per second. You have to take multiple readings to know anything.

A Gauge32 on the other hand, measures some quantity at a moment in time and may go up or down. You can't necessarily make meaningful observations about two (or more) readings over time. An example of this is free disk space. You can fetch the value now, and an hour from now, and find that the change is zero -- but you can't draw the conclusion that nothing has been written to disk over the course of the hour. It's possible that the disk is getting hammered with constant additions and deletions that do not result in a net change in free space.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...