|
|
| Author |
Message |
erwan.l Cacti User
Joined: 22 Jan 2008 Posts: 72
|
|
| Back to top |
|
 |
viras
Joined: 24 Aug 2008 Posts: 16
|
Posted: Sat Aug 30, 2008 6:55 am Post subject: |
|
|
Yeeessss, all works perfectly Thanks, thanks, thanks!
Here that I have written in counters.ini:
[1.3.6.1.4.1.15.51.1.1]
type=string
counter=1
[1.3.6.1.4.1.15.51.1.2]
type=string
counter=2
[1.3.6.1.4.1.15.51.2.1]
type=string
counter=Total Sessions
[1.3.6.1.4.1.15.51.2.2]
type=string
counter=Active Sessions
[1.3.6.1.4.1.15.51.3.1]
counter=Terminal Services\Total Sessions
[1.3.6.1.4.1.15.51.3.2]
counter=Terminal Services\Active Sessions
|
|
| Back to top |
|
 |
erwan.l Cacti User
Joined: 22 Jan 2008 Posts: 72
|
Posted: Sat Aug 30, 2008 7:00 am Post subject: |
|
|
Glad I could help
Eventually, post your graphs and template for others to benefit from your work.
And, thanks a lot for your time & debugging : it does help a lot to improve that tool.
Regards,
Erwan.
|
|
| Back to top |
|
 |
viras
Joined: 24 Aug 2008 Posts: 16
|
Posted: Sun Aug 31, 2008 12:27 am Post subject: |
|
|
Probably one more defect...
In your program SNMP v.2 protocol is not supported, only v.1 I on was pushed on this thought with the message in a forum: http://forums.cacti.net/viewtopic.php?t=27666
Having looked in an initial code cacti (the file snmp.php) can be found such fragment:
if ($version == "1") {
$temp_array = @snmprealwalk("$hostname:$port", "$community", "$oid", ($timeout * 1000), $retries);
}elseif ($version == "2") {
$temp_array = @snmp2_real_walk("$hostname:$port", "$community", "$oid", ($timeout * 1000), $retries);
}else{
And so if version 1 all works, and at version 2 $temp_array it is empty.
|
|
| Back to top |
|
 |
erwan.l Cacti User
Joined: 22 Jan 2008 Posts: 72
|
Posted: Sun Aug 31, 2008 4:48 am Post subject: |
|
|
Hello Viras,
The SNMP agent, hosted by the MS SNMP service, actually does not deal with the snmp version.
Whatsmore, the snmpwalk command line currently works with both version :
snmpwalk -v 2c -c public 127.0.0.1 1.3.6.1.4.1.15
or
snmpwalk -v 1 -c public 127.0.0.1 1.3.6.1.4.1.15
Both work and return the same value.
Reading the post you are mentionning, I suspect an issue at the cacti level (or one of its component).
Still, I'll do extensive check to exclude any error within snmptools.
Basically, if the request fails but you see 'SnmpExtensionQuery' in the log file, then it is an snmptools bug.
If the request fails and you dont see 'SnmpExtensionQuery', then its an issue at the snmp service or within cacti.
Last edited by erwan.l on Sun Aug 31, 2008 5:51 am; edited 1 time in total |
|
| Back to top |
|
 |
erwan.l Cacti User
Joined: 22 Jan 2008 Posts: 72
|
Posted: Sun Aug 31, 2008 5:38 am Post subject: |
|
|
version 2.0.0.3 released.
http://erwan.l.free.fr/snmptools/snmptools2.zip
In previous versions, the dll was exporting these 2 functions :
SnmpExtensioninit (when the agent is loaded by the snmp service)
SnmpExtensionQuery (when the agent is receiving a request)
SnmpExtensionQuery only support snmp v1 type : get, getnext and set.
I have now added a 3rd exported function :
SnmpExtensionQueryEx which will support other v2 types (get, getnext, settest, setundo, setcommit, setcleanup).
details here : http://msdn.microsoft.com/en-us/library/aa378022(VS.85).aspx .
The agent still support only get & getnext requests but at least it will accept other types, and will also log it eventually.
I dont believe this is linked to the issue with snmp v2 from cacti (since simple v2 types were supported from the command line) but at least the code is cleaner
Regards,
Erwan.
|
|
| Back to top |
|
 |
viras
Joined: 24 Aug 2008 Posts: 16
|
Posted: Sun Aug 31, 2008 8:45 am Post subject: |
|
|
All the same does not work.
That I did:
1. The menu "Devices"
2. Has chosen the server
3. Has at the very bottom pressed "Verbose Query"
| Description: |
|
 Download |
| Filename: |
conters.txt |
| Filesize: |
798 Bytes |
| Downloaded: |
46 Time(s) |
| Description: |
|
 Download |
| Filename: |
log-v2.txt |
| Filesize: |
42.67 KB |
| Downloaded: |
31 Time(s) |
| Description: |
|
 Download |
| Filename: |
log-v1.txt |
| Filesize: |
2.42 KB |
| Downloaded: |
28 Time(s) |
|
|
| Back to top |
|
 |
erwan.l Cacti User
Joined: 22 Jan 2008 Posts: 72
|
Posted: Sun Aug 31, 2008 11:23 am Post subject: |
|
|
nice one Viras.
Indeed there was a bug when walking the oid's (the last oid was not handled correctly).
version 2.0.0.4 released.
http://erwan.l.free.fr/snmptools/snmptools2.zip
I was looking on a issue linked to snmp v1 or v2 where actually there was a bug in the logic.
Thanks for the debugging !
Regards,
Erwan.
|
|
| Back to top |
|
 |
viras
Joined: 24 Aug 2008 Posts: 16
|
Posted: Sun Aug 31, 2008 1:03 pm Post subject: |
|
|
Thanks for the program!
Errors have disappeared, but version 2 does not work. Cacti here it is not guilty, as causes standard function snmp2_real_walk. A problem or in snmp service, or in your program.
| Description: |
|
 Download |
| Filename: |
log-v2.txt |
| Filesize: |
7.17 KB |
| Downloaded: |
30 Time(s) |
|
|
| Back to top |
|
 |
erwan.l Cacti User
Joined: 22 Jan 2008 Posts: 72
|
Posted: Sun Aug 31, 2008 2:43 pm Post subject: |
|
|
indeed, I cant use a dataquery in snmp v2 where it works fine in snmp v1.
in v2 i get
+ Executing SNMP walk for list of indexes @ '.1.3.6.1.4.1.15.51.1'
+ No SNMP data returned
where in v1 i get
+ Executing SNMP walk for list of indexes @ '.1.3.6.1.4.1.15.51.1'
+ Located input field 'memIndex' [walk]
wierd thing is that snmpwalk works fine via the command line and the snmptools log looks identical in both cases:
snmpwalk -v 2c -c public 127.0.0.1 1.3.6.1.4.1.15.51.1
SNMPv2-SMI::enterprises.15.51.1.1 = INTEGER: 1
SNMPv2-SMI::enterprises.15.51.1.2 = INTEGER: 2
working on it.
/erwan
|
|
| Back to top |
|
 |
viras
Joined: 24 Aug 2008 Posts: 16
|
Posted: Sun Aug 31, 2008 11:28 pm Post subject: |
|
|
| Try to use snmpbulkwalk...
|
|
| Back to top |
|
 |
viras
Joined: 24 Aug 2008 Posts: 16
|
Posted: Mon Sep 01, 2008 2:41 am Post subject: |
|
|
Here my first work server.
| Description: |
|
| Filesize: |
24.18 KB |
| Viewed: |
953 Time(s) |

|
| Description: |
|
| Filesize: |
34.21 KB |
| Viewed: |
953 Time(s) |

|
|
|
| Back to top |
|
 |
erwan.l Cacti User
Joined: 22 Jan 2008 Posts: 72
|
Posted: Mon Sep 01, 2008 11:57 am Post subject: |
|
|
Very nice
I like what you did with the snmp query : did not know about this before.
I learned something
Need to fix that snmpv2 thing now.
snmpbulkwalk from the command line work fine as well.
I need to dig into cacti to see how the data is queryed.
Thanks,
Erwan
|
|
| Back to top |
|
 |
viras
Joined: 24 Aug 2008 Posts: 16
|
Posted: Mon Sep 01, 2008 11:36 pm Post subject: |
|
|
/usr/local/share/cacti/lib/snmp.php
function cacti_snmp_walk
line 253-256
if ($version == "1") {
$temp_array = @snmprealwalk("$hostname:$port", "$community", "$oid", ($timeout * 1000), $retries);
}elseif ($version == "2") {
$temp_array = @snmp2_real_walk("$hostname:$port", "$community", "$oid", ($timeout * 1000), $retries);
}else{
|
|
| Back to top |
|
 |
ky
Joined: 03 Sep 2008 Posts: 5
|
Posted: Wed Sep 03, 2008 2:24 pm Post subject: Trouble w/64bit on Server 2003 SP2 |
|
|
Erwan,
*Awesome* tool, once I get it working. Our environment is primarily 64bit (Server 2003 SP2) and I have done the following to get set up:
-Renamed snmptools64.dll to snmptools.dll, moved it to proper dir.
-Configured counters.ini
-Turned on debugging, imported reg file, restarted SNMP.
I am able to query 1.3.6.1.4.1.15 (snmptools by erwan.l@free.fr), I can query anything that defines type=string in counters.ini, but I am not able to get any data from the performance counters.
For these definitions:
[1.3.6.1.4.1.15.1]
counter=PhysicalDisk\Avg. Disk Queue Length\_Total
[1.3.6.1.4.1.15.6]
counter=Processor\% Processor Time
I get this in the log:
14:07:11:465 , SnmpExtensionQueryEx
14:07:11:465 , nRequestType=SNMP_EXTENSION_GET
14:07:11:465 , GetRequest: OID=1.3.6.1.4.1.15 (7)
14:07:11:465 , result=snmptools by erwan.l@free.fr asn_type=4
14:07:11:465 , GetRequest OK
14:15:30:029 , SnmpExtensionQueryEx
14:15:30:029 , nRequestType=SNMP_EXTENSION_GET
14:15:30:029 , GetRequest: OID=1.3.6.1.4.1.15.1 (
14:15:30:029 , path=PhysicalDisk\Avg. Disk Queue Length\_Total
14:15:30:029 , PhysicalDisk\Avg. Disk Queue Length\_Total
14:15:30:029 , makepathA : C0000BBD
14:15:30:029 , length(str_result)=0
14:15:30:029 , GetRequest Failed
14:20:54:316 , SnmpExtensionQueryEx
14:20:54:316 , nRequestType=SNMP_EXTENSION_GET
14:20:54:316 , GetRequest: OID=1.3.6.1.4.1.15.6 (
14:20:54:316 , path=Processor\% Processor Time
14:20:54:316 , Processor\% Processor Time\
14:20:54:316 , makepathA : C0000BBD
14:20:54:316 , length(str_result)=0
14:20:54:316 , GetRequest Failed
Any suggestions?
Thanks in advance, can't wait to get this going!
-Kyle
|
|
| Back to top |
|
 |
|
Powered by phpBB © 2001, 2005 phpBB Group
|
|