Cacti (home)ForumsDocumentation
Cacti: offical forums and support
It is currently Thu Dec 14, 2017 12:06 pm

All times are UTC - 5 hours




Post new topic Reply to topic  [ 1 post ] 
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: 123
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.21
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  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 1 post ] 

All times are UTC - 5 hours


Who is online

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