Cacti (home)ForumsDocumentation
Cacti: offical forums and support
It is currently Fri Mar 24, 2017 7:25 am

All times are UTC - 5 hours




Post new topic Reply to topic  [ 7 posts ] 
Author Message
 Post subject: Option to snmp_cacti_get
PostPosted: Wed Mar 15, 2017 9:59 am 
Online
Cacti User

Joined: Wed Dec 07, 2011 9:19 am
Posts: 127
I need to add the -Ox option to some snmp_get query, is there a way of doing it ?

otherwise net_snmp is interpreting the output of any snmp_get and it will give a bad value

_________________
CentOS
Cacti 0.8.8h
Spine 0.8.8h
PIA 3.1
Aggregate 0.75
Monitor 1.3
Settings 0.71
Weathermap 0.98
Thold 0.5
rrdclean 0.41

Own plugin: LinkDiscovery 0.3


Top
 Profile  
 
 Post subject: Re: Option to snmp_cacti_get
PostPosted: Fri Mar 17, 2017 11:36 am 
Offline
Cacti User
User avatar

Joined: Mon Jan 05, 2015 10:10 am
Posts: 109
Can you be more specific?

_________________
Before history, there was a paradise, now dust.


Top
 Profile  
 
 Post subject: Re: Option to snmp_cacti_get
PostPosted: Mon Mar 20, 2017 5:05 am 
Online
Cacti User

Joined: Wed Dec 07, 2011 9:19 am
Posts: 127
Yes I can ;)

Here is 2 queries, first with the option -Ox,
[root@lslcact01:/usr/share/cacti/plugins/linkdiscovery] # snmpwalk -v2c -ctelvlsn se-sve-225 -Ox .1.3.6.1.4.1.9.9.23.1.2.1.1.4
SNMPv2-SMI::enterprises.9.9.23.1.2.1.1.4.10108.3 = Hex-STRING: 0A 55 79 43
SNMPv2-SMI::enterprises.9.9.23.1.2.1.1.4.10109.2 = Hex-STRING: 0A 55 00 E0
SNMPv2-SMI::enterprises.9.9.23.1.2.1.1.4.10110.5 = Hex-STRING: 0A 55 00 01

[root@lslcact01:/usr/share/cacti/plugins/linkdiscovery] # snmpwalk -v2c -ctelvlsn se-sve-225 .1.3.6.1.4.1.9.9.23.1.2.1.1.4
SNMPv2-SMI::enterprises.9.9.23.1.2.1.1.4.10108.3 = STRING: "
UyC"
SNMPv2-SMI::enterprises.9.9.23.1.2.1.1.4.10109.2 = Hex-STRING: 0A 55 00 E0
SNMPv2-SMI::enterprises.9.9.23.1.2.1.1.4.10110.5 = Hex-STRING: 0A 55 00 01

from an email I get on the net-snmp mailing list if snmpwalk receive character higher than 0x20 it will interpret it, no if it's under 0x20.
So since the record I pull is IP address, when I receive 0x79 (the third number) all string is higher than 0x20, so snmpwalk is interpreting it, and give a CR (0x0a), so Cacti is taking this CR and return false result, actually it will give me 4 records from this snmpwalk instead of 3.

The only option is to tel snmpwalk to do print all field in ex format, option -Ox.
You can look into github closed issue #288 but the snmp_get_raw dosen't fix the issue, since it's from the way snmpget (walk) handle the value it read from the snmp queries, and not from cacti

_________________
CentOS
Cacti 0.8.8h
Spine 0.8.8h
PIA 3.1
Aggregate 0.75
Monitor 1.3
Settings 0.71
Weathermap 0.98
Thold 0.5
rrdclean 0.41

Own plugin: LinkDiscovery 0.3


Top
 Profile  
 
 Post subject: Re: Option to snmp_cacti_get
PostPosted: Tue Mar 21, 2017 7:10 am 
Offline
Cacti User
User avatar

Joined: Mon Jan 05, 2015 10:10 am
Posts: 109
Okay, this makes sense. Is this for a plugin or for a Data Query 'input' type?

_________________
Before history, there was a paradise, now dust.


Top
 Profile  
 
 Post subject: Re: Option to snmp_cacti_get
PostPosted: Tue Mar 21, 2017 7:42 am 
Online
Cacti User

Joined: Wed Dec 07, 2011 9:19 am
Posts: 127
Actually it's for a plug-in
Like Discovery but 100% based on CDP, it will allow me to discover only link between my device (switch, router), known and unknown device, and give me thold alert when a like go down.

_________________
CentOS
Cacti 0.8.8h
Spine 0.8.8h
PIA 3.1
Aggregate 0.75
Monitor 1.3
Settings 0.71
Weathermap 0.98
Thold 0.5
rrdclean 0.41

Own plugin: LinkDiscovery 0.3


Top
 Profile  
 
 Post subject: Re: Option to snmp_cacti_get
PostPosted: Tue Mar 21, 2017 11:22 am 
Offline
Cacti User
User avatar

Joined: Mon Jan 05, 2015 10:10 am
Posts: 109
So, I looked at php-snmp, and sadly it's currently lacking the ability to control output options outside of some very simple constructs. This could be done, but it would have to be done using the net-snmp binaries and not php-snmp for the moment. You should open a ticket on GitHub in any event. I'm sure Jimmy would give it some attention.

_________________
Before history, there was a paradise, now dust.


Top
 Profile  
 
 Post subject: Re: Option to snmp_cacti_get
PostPosted: Wed Mar 22, 2017 1:12 am 
Online
Cacti User

Joined: Wed Dec 07, 2011 9:19 am
Posts: 127
Well I did, and that was the origin of the creation of cacti_snmp_get_raw, but it not sole my need

_________________
CentOS
Cacti 0.8.8h
Spine 0.8.8h
PIA 3.1
Aggregate 0.75
Monitor 1.3
Settings 0.71
Weathermap 0.98
Thold 0.5
rrdclean 0.41

Own plugin: LinkDiscovery 0.3


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 7 posts ] 

All times are UTC - 5 hours


Who is online

Users browsing this forum: Bing [Bot], Rno and 7 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  

Protected by Anti-Spam ACP Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group