POLA violation?: snmp renumbering stuff

2003-11-23 Thread paul beard
For some reason, my locally installed snmp daemons decided to renumber 
the elements in the hrStorageTable, meaning all the attached disks were 
being either misreported or just plain dropped from my graphs 
(paulbeard.no-ip.org/mrtg/blue/index.html). Not that the new numbering 
doesn't make sense but I didn't know this was going to happen.

How to discover and fix it? snmptable is my friend. As shown here, the 
memory used by the kernel is listed first, followed by the disks. The 
disks were numbered starting at 1 before . . . . .

[/www/mrtg/blue]# snmptable -c community name blue hrStorageTable
SNMP table: HOST-RESOURCES-MIB::hrStorageTable
hrStorageIndex hrStorageType hrStorageDescr hrStorageAllocationUnits 
hrStorageSize hrStorageUsed hrStorageAllocationFailures
1 HOST-RESOURCES-TYPES::hrStorageOther Memory Buffers 256 Bytes ? 192 0
2 HOST-RESOURCES-TYPES::hrStorageRam Real Memory 4096 Bytes ? 3241 ?
3 HOST-RESOURCES-TYPES::hrStorageVirtualMemory Swap Space 4096 Bytes ? 
19625 ?
4 HOST-RESOURCES-TYPES::hrStorageFixedDisk / 1024 Bytes ? 83592 ?
5 HOST-RESOURCES-TYPES::hrStorageFixedDisk /usr 1024 Bytes ? 3639961 ?
6 HOST-RESOURCES-TYPES::hrStorageFixedDisk /var 1024 Bytes ? 8015 ?
7 HOST-RESOURCES-TYPES::hrStorageFixedDisk /proc 4096 Bytes ? 1 ?
8 HOST-RESOURCES-TYPES::hrStorageFixedDisk /usr/ports 512 Bytes ? 
35548516 ?
--
Paul Beard
paulbeard.no-ip.org/movabletype/
paulbeard [at] mac.com

___
[EMAIL PROTECTED] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: POLA violation?: snmp renumbering stuff

2003-11-23 Thread Dan Nelson
In the last episode (Nov 23), paul beard said:
 For some reason, my locally installed snmp daemons decided to
 renumber the elements in the hrStorageTable, meaning all the attached
 disks were being either misreported or just plain dropped from my
 graphs (paulbeard.no-ip.org/mrtg/blue/index.html). Not that the new
 numbering doesn't make sense but I didn't know this was going to
 happen.
 
 How to discover and fix it? snmptable is my friend. As shown here,
 the memory used by the kernel is listed first, followed by the disks.
 The disks were numbered starting at 1 before . . . . .

I don't think snmp tables have any defined order.  I don't even know if
the index for a particular resource is guaranteed to be stable across
filesystem dismount/remounts.  Something like this should work:

snmptable -Cf : blue hrStorageTable | grep :/var: | awk -F : '{print $4 * $5}' 

I use something similar in a script to graph disk usage in mrtg.  It
sould be really nice if snmptable had a built-in flag to print a
particular cell from a table, though.

-- 
Dan Nelson
[EMAIL PROTECTED]
___
[EMAIL PROTECTED] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: POLA violation?: snmp renumbering stuff

2003-11-23 Thread paul beard
On Nov 23, 2003, at 6:00 PM, Dan Nelson wrote:

I don't think snmp tables have any defined order.  I don't even know if
the index for a particular resource is guaranteed to be stable across
filesystem dismount/remounts.  Something like this should work:
My issue was that they shouldn't change once defined: otherwise, how 
can you reliably use something if it adopts different behavior with 
each new release/build?

After all, we're not talking about Windows here . . . .  ;-)

It would be useful if / were always 1, for example. It looks like, with 
the inclusion of RAM and swap in the table, / might be 3.

--
Paul Beard
paulbeard.no-ip.org/movabletype/
paulbeard [at] mac.com
___
[EMAIL PROTECTED] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]