On my network, I have several wireless access points deployed that will expose the IP address of any connected clients, but not the number of active clients. I can query a single OID and get all the IP addresses back, each with a unique OID. For example, I query <my OID> and get back <my OID>.###.###.### and the data field will contain the IP address.
I have tried to follow the "Script Data Query Walkthrough" from the documentation wiki, but have been utterly unsuccessful. I can query and get back a result like 1!10 (index!active_clients), but I can't get this to graph successfully.
Is there a simple way to do this - to count the number of rows returned by the SNMP query?
Count Items
Moderators: Developers, Moderators
- gandalf
- Developer
- Posts: 22383
- Joined: Thu Dec 02, 2004 2:46 am
- Location: Muenster, Germany
- Contact:
Re: Count Items
Please see http://forums.cacti.net/viewtopic.php?f=12&t=30182; does this help?
R.
R.
Re: Count Items
I looked at this and followed it pretty closely. It did not really help much.gandalf wrote:Please see http://forums.cacti.net/viewtopic.php?f=12&t=30182; does this help?
R.
I went back through the original walk through and followed it much more closely. I started from scratch and was able to get this working. I did, however, need to copy and modify the cacti_snmp_walk function because - while I prefer to use PHP's built in SNMP function - the OIDs the device use are non-ascending.
- gandalf
- Developer
- Posts: 22383
- Joined: Thu Dec 02, 2004 2:46 am
- Location: Muenster, Germany
- Contact:
Re: Count Items
Asked our php-snmp guru to have a look
R.
R.
Re: Count Items
Do you mean you need to set -Cc for snmpwalk command in order to get all results from subtree?dmeiser wrote:the OIDs the device use are non-ascending.
As for "number of rows returned".
Basically Cacti poller currently has no ability to count OID number in some subtree: this may be rather expensive for poller. Besides, how do you expect poller to count rows when your OID subtree has more than one indexed leaf:
Code: Select all
.1.1 = Name1
.2.1 = value1
.1.2 = Name2
.2.2 = value2
...
If digging further, I would like to have poller to retrieve count of OID with matching value and so on and so on.
All this math is a complex pile of logic and I am not sure it should be in poller.
Re: Count Items
That is exactly what I am saying.BorisL wrote:Do you mean you need to set -Cc for snmpwalk command in order to get all results from subtree?
I tend to agree... for complex OIDs that would be problematic. This would never work, for example, for counting the interfaces of a 48 port switch because those would have sub-IDs. I only asked because it seemed like something that might be there.BorisL wrote:Basically Cacti poller currently has no ability to count OID number in some subtree: this may be rather expensive for poller. Besides, how do you expect poller to count rows when your OID subtree has more than one indexed leaf:
All this math is a complex pile of logic and I am not sure it should be in poller.
Is there a way to call cacti-snmp-walk to force cacti-snmp-walk to use NET-SNMP or UCD-SNMP?
Re: Count Items
There is a better way I think. You can compile php-snmp code from php svn trunk (php-snmp in trunk is backwards compatible downto php5.2), install my cummulative patch and add one line to cacti_snmp_session() function setting oid_increasing_check property to false.dmeiser wrote:Is there a way to call cacti-snmp-walk to force cacti-snmp-walk to use NET-SNMP or UCD-SNMP?
This will leave Cacti with php-snmp module (trunk one is much faster

Who is online
Users browsing this forum: No registered users and 2 guests