Cacti (home)ForumsDocumentation
Cacti: offical forums and support
It is currently Mon Jul 16, 2018 5:22 am

All times are UTC - 5 hours




Post new topic Reply to topic  [ 2 posts ] 
Author Message
 Post subject: [HELP]SNMP Data query
PostPosted: Mon Oct 30, 2017 6:02 pm 
Offline
Cacti User
User avatar

Joined: Wed Jul 20, 2016 8:00 pm
Posts: 148
Hi there,

I'm trying to create a custom snmp data query to get some values.

So I use this OID as index because if the OID exists the sensor is present, otherwise you get a whole lot of notpresent sensors.
Code:
<oid_index>.1.3.6.1.4.1.9.9.91.1.1.1.1.5</oid_index>


This is a snmpwalk sample:
Code:
.1.3.6.1.4.1.9.9.91.1.1.1.1.5.24 = INTEGER: 1
.1.3.6.1.4.1.9.9.91.1.1.1.1.5.25 = INTEGER: 1
.1.3.6.1.4.1.9.9.91.1.1.1.1.5.26 = INTEGER: 1
.1.3.6.1.4.1.9.9.91.1.1.1.1.5.27 = INTEGER: 1
.1.3.6.1.4.1.9.9.91.1.1.1.1.5.28 = INTEGER: 1
.1.3.6.1.4.1.9.9.91.1.1.1.1.5.7001 = INTEGER: 1
.1.3.6.1.4.1.9.9.91.1.1.1.1.5.7002 = INTEGER: 1
.1.3.6.1.4.1.9.9.91.1.1.1.1.5.7003 = INTEGER: 1


So that's alright and I'm getting the values I want and the data query works fine.

My problem comes when I want to pull the threshold value which is in this format, for every sensor index you could end up having up to 4 values.

snmpwalk sample:

Code:
.1.3.6.1.4.1.9.9.91.1.2.1.1.4.24.1 = INTEGER: 4500
.1.3.6.1.4.1.9.9.91.1.2.1.1.4.25.1 = INTEGER: 4500
.1.3.6.1.4.1.9.9.91.1.2.1.1.4.26.1 = INTEGER: 4500
.1.3.6.1.4.1.9.9.91.1.2.1.1.4.27.1 = INTEGER: 4500
.1.3.6.1.4.1.9.9.91.1.2.1.1.4.7001.1 = INTEGER: -2
.1.3.6.1.4.1.9.9.91.1.2.1.1.4.7001.2 = INTEGER: 42
.1.3.6.1.4.1.9.9.91.1.2.1.1.4.7001.3 = INTEGER: 47
.1.3.6.1.4.1.9.9.91.1.2.1.1.4.7002.1 = INTEGER: -2
.1.3.6.1.4.1.9.9.91.1.2.1.1.4.7003.1 = INTEGER: -2
.1.3.6.1.4.1.9.9.91.1.2.1.1.4.7003.2 = INTEGER: 70
.1.3.6.1.4.1.9.9.91.1.2.1.1.4.7003.3 = INTEGER: 75


So this is basically changing the logic and you get what you want after the index .[1-3] where 1=Low Warning, 2=High Warning, 3=Low Alarm and 4 High Alarm.

Let's say I only care about getting Low Warning threshold value.

Is there any way to tell cacti something like <oid>.1.3.6.1.4.1.9.9.91.1.2.1.1.4.[INDEX].1</oid>

Code:
<entSensorThresholdValue>
                        <name>SensorThresholdValue</name>
                        <method>get</method>
                        <source>value</source>
                        <direction>input-output</direction>
                        <oid>.1.3.6.1.4.1.9.9.91.1.2.1.1.4</oid>
</entSensorThresholdValue>


I'm running cacti 1.x

Any ideas? I'm not asking for scripts, I just want to know if there is any way of make cacti do this without an script.

Thanks

_________________
Cacti - 1.1.37
Poller Type - Spine
Weathermap 0.98a
Server Info - Linux 3.10.0 - Centos 7
Web Server - Apache/2.4.6 PHP 5.4.16
MySQL - 5.5 ;RRDTool - 1.4.8 ;SNMP - 5.7.2
Religion - Anti forum pets
Code:
SYSTEM STATS: Time:17.7383 Method:spine Processes:1 Threads:10 Hosts:279 HostsPerProcess:279 DataSources:7309 RRDsProcessed:3718

Code:
WEATHERMAP STATS: Weathermap 0.98 run complete - Thu, 16 Nov 17 08:42:56 +1300: 39 maps were run in 23.22 seconds with 0 warnings.


Top
 Profile  
 
 Post subject: Re: [HELP]SNMP Data query
PostPosted: Wed Jun 20, 2018 9:28 am 
Offline
Cacti User
User avatar

Joined: Mon Oct 02, 2006 1:22 pm
Posts: 209
Location: Belgium
A bit late to the party here, but :

Did you try a regexp where you only match the xxxx.number.1 ?


<oid_index>.1.3.6.1.4.1.9.9.91.1.2.1.1.4</oid_index>
<oid_index_parse>OID/REGEXP:.*\.([0-9]{1,10}[.][1]{1})$</oid_index_parse>

your indexes would then be 24.1 25.1 26.1 7001.1 etc...

_________________
Joris.
http://www.routerjanitor.com


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

All times are UTC - 5 hours


Who is online

Users browsing this forum: No registered users and 6 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