Cacti (home)ForumsDocumentation
Cacti: offical forums and support
It is currently Wed Feb 20, 2019 2:52 pm

All times are UTC - 5 hours




Post new topic Reply to topic  [ 20 posts ]  Go to page 1, 2  Next
Author Message
 Post subject: [SOLVED] Graph Uptime on Telrad 7000
PostPosted: Mon Mar 05, 2018 7:45 am 
Offline

Joined: Mon Mar 05, 2018 5:41 am
Posts: 15
Hi,

For a few days I'm trying to manipulate the XML file in order to display the result of the OID (string) in the list of ITEMS.

I managed to make the string appear in this list but the RRD file can't be generated. On the other hand if I parse the OID with the REGEX function and return the last value (ex: ".0"), then the RRD is well created.

But for a good use I prefer to appear in the list the string which is more speaking rather than a simple number.

Here is my actual XML file (working) :
Code:
<interface>
        <name>Get SNMP Device</name>
        <description>Queries Device</description>
        <oid_index>.1.3.6.1.4.1.17713.20.2.1.4.2.0</oid_index>
        <oid_index_parse>OID/REGEXP:^.{30}(.*)$</oid_index_parse>
        <index_order>Index</index_order>
        <index_order_type>alphabetic</index_order_type>
        <fields>
                <Index>
                       <name>Index</name>
                       <source>index</source>
                       <direction>input</direction>
                </Index>
                <Frequency>
                        <method>get</method>
                        <source>VALUE/REGEXP:([0-9]*)</source>
                        <direction>output</direction>
                        <oid>.1.3.6.1.4.1.17713.20.2.1.1.4</oid>
                </Frequency>
                <Rssi>
                        <method>get</method>
                        <source>value</source>
                        <direction>output</direction>
                        <oid>.1.3.6.1.4.1.17713.20.2.1.1.7.0</oid>
                </Rssi>
                <CinrR1>
                        <method>get</method>
                        <source>value</source>
                        <direction>output</direction>
                        <oid>.1.3.6.1.4.1.17713.20.2.1.1.9</oid>
                </CinrR1>
                <CinrR3>
                        <method>get</method>
                        <source>value</source>
                        <direction>output</direction>
                        <oid>.1.3.6.1.4.1.17713.20.2.1.1.10.0</oid>
                </CinrR3>
        </fields>
</interface>


Data Query Debug Information :
Code:
Total: 0, Delta: 0, Running data query [73].
Total: 0, Delta: 0, Found type = '3' [SNMP Query].
Total: 0, Delta: 0, Found data query XML file at '/usr/local/share/cacti/resource/snmp_queries/telrad7000-radio.xml'
Total: 0, Delta: 0, XML file parsed ok.
Total: 0, Delta: 0, <oid_num_indexes> missing in XML file, 'Index Count Changed' emulated by counting oid_index entries
Total: 0.47, Delta: 0.46, Executing SNMP walk for list of indexes @ '.1.3.6.1.4.1.17713.20.2.1.4.2.0' Index Count: 1
Total: 0.47, Delta: 0, Index found at OID: '.1.3.6.1.4.1.17713.20.2.1.4.2.0' value: 'CPE7000'
Total: 0.47, Delta: 0, index_parse at OID: '.1.3.6.1.4.1.17713.20.2.1.4.2.0' results: '0'
Total: 0.47, Delta: 0, Inserting index data for field 'Index' [value='0']
Total: 0.47, Delta: 0, Update data query sort cache complete
Total: 0.47, Delta: 0, Updated data query index ordering
Total: 0.53, Delta: 0.06, Update re-index cache complete
Total: 0.53, Delta: 0, Update graph data query cache complete
Total: 0.53, Delta: 0, Update data source data query cache complete
Total: 0.53, Delta: 0, Update data query cache complete
Total: 0.54, Delta: 0, Update poller cache from query complete
Total: 0.54, Delta: 0, Automation execute data query complete
Total: 0.54, Delta: 0, Plugin hooks complete


But if I modify the XML file to parse the string to show it in the list items that doesn't get value from device and RRD file is not created.
Code:
<interface>
        <name>Get SNMP TELRAD</name>
        <description>Queries CPE Telrad 7000 - WiMax</description>
        <oid_index>.1.3.6.1.4.1.17713.20.2.1.4.2.0</oid_index>
        <oid_index_parse>OID/REGEXP:^.{31}(.*)$</oid_index_parse>
        <index_order>Index</index_order>
        <index_order_type>alphabetic</index_order_type>
        <fields>
                <Index>
                       <name>Index</name>
                       <method>walk</method>
                       <source>value</source>
                       <direction>input</direction>
                       <oid>.1.3.6.1.4.1.17713.20.2.1.4.2.0</oid>
                </Index>
                <Frequency>
                        <method>get</method>
                        <source>VALUE/REGEXP:([0-9]*)</source>
                        <direction>output</direction>
                        <oid>.1.3.6.1.4.1.17713.20.2.1.1.4</oid>
                </Frequency>
                <Rssi>
                        <method>get</method>
                        <source>value</source>
                        <direction>output</direction>
                        <oid>.1.3.6.1.4.1.17713.20.2.1.1.7.0</oid>
                </Rssi>
                <CinrR1>
                        <method>get</method>
                        <source>value</source>
                        <direction>output</direction>
                        <oid>.1.3.6.1.4.1.17713.20.2.1.1.9</oid>
                </CinrR1>
                <CinrR3>
                        <method>get</method>
                        <source>value</source>
                        <direction>output</direction>
                        <oid>.1.3.6.1.4.1.17713.20.2.1.1.10.0</oid>
                </CinrR3>
        </fields>
</interface>


Data Query Debug Information :
Code:
Total: 0, Delta: 0, Running data query [73].
Total: 0, Delta: 0, Found type = '3' [SNMP Query].
Total: 0, Delta: 0, Found data query XML file at '/usr/local/share/cacti/resource/snmp_queries/telrad7000-radio.xml'
Total: 0, Delta: 0, XML file parsed ok.
Total: 0, Delta: 0, <oid_num_indexes> missing in XML file, 'Index Count Changed' emulated by counting oid_index entries
Total: 0.47, Delta: 0.47, Executing SNMP walk for list of indexes @ '.1.3.6.1.4.1.17713.20.2.1.4.2.0' Index Count: 1
Total: 0.47, Delta: 0, Index found at OID: '.1.3.6.1.4.1.17713.20.2.1.4.2.0' value: 'CPE7000'
Total: 0.47, Delta: 0, index_parse at OID: '.1.3.6.1.4.1.17713.20.2.1.4.2.0' results: ''
Click to show data query output for field 'Index'
Total: 0.47, Delta: 0, Located input field 'Index' [walk]
Total: 0.94, Delta: 0.47, Executing SNMP walk for data @ '.1.3.6.1.4.1.17713.20.2.1.4.2.0'
Found item [Index='CPE7000'] index: [from value]
Total: 0.94, Delta: 0, Update data query sort cache complete
Total: 0.94, Delta: 0, Updated data query index ordering
Total: 1, Delta: 0.06, Update re-index cache complete
Total: 1, Delta: 0, Update graph data query cache complete
Total: 1, Delta: 0, Update data source data query cache complete
Total: 1, Delta: 0, Update data query cache complete
Total: 1.01, Delta: 0, Update poller cache from query complete
Total: 1.01, Delta: 0, Automation execute data query complete
Total: 1.01, Delta: 0, Plugin hooks complete


I tried to follow the official doc (https://docs.cacti.net/howto:data_query_templates#data_query_templates) but that return the full OID lenght and in my case I prefer the string result.

It's possible to set the items list from string value and get all values from OID in the xml file ? If not, can i set manually the name of the item list ?

Thank you in advance for your help.

BR.


Last edited by oijkn on Fri Nov 09, 2018 6:22 am, edited 1 time in total.

Top
 Profile  
 
 Post subject: Re: XML parse STRING from OID to set ITEMS
PostPosted: Thu Mar 08, 2018 5:01 am 
Offline
Cacti Guru User

Joined: Sun Aug 27, 2017 12:05 am
Posts: 2067
If I'm reading that rightly, your index parse is saying to find .31. which isn't present in the output above.

_________________
Official Cacti Developer

Cacti Resources:
Cacti Website (including releases)
Cacti Issues
Cacti Development Releases
Cacti Development Documentation

My resources:
How to submit Pull Requests
Development Wiki and How To's
Updated NetSNMP Memory template for Cacti 1.x
Cisco SFP template for Cacti 0.8.8


Top
 Profile  
 
 Post subject: Re: XML parse STRING from OID to set ITEMS
PostPosted: Fri Nov 09, 2018 6:17 am 
Offline

Joined: Mon Mar 05, 2018 5:41 am
Posts: 15
netniV wrote:
If I'm reading that rightly, your index parse is saying to find .31. which isn't present in the output above.


Hello netniV,

Sorry for the late but i was on other project and i'm back again ^^
If I remove the regex of <oid_index_parse> like bellow the debug information returns me the OID and not the string.

What I'm doing wrong, please ?

There is any existing template for Telrad 7000 ?

Thank you in advance for the help :)

--> <oid_index_parse>OID/REGEXP:</oid_index_parse>

Data Query Debug Information :
Code:
Total: 0.000000, Delta: 0.000000, Running data query [73].
Total: 0.000000, Delta: 0.000000, Found type = '3' [SNMP Query].
Total: 0.000000, Delta: 0.000000, Found data query XML file at '/usr/local/share/cacti/resource/snmp_queries/telrad7000-radio.xml'
Total: 0.000000, Delta: 0.000000, XML file parsed ok.
Total: 0.000000, Delta: 0.000000, <oid_num_indexes> missing in XML file, 'Index Count Changed' emulated by counting oid_index entries
Total: 5.120000, Delta: 5.120000, Executing SNMP walk for list of indexes @ '.1.3.6.1.4.1.17713.20.2.1.4.2.0' Index Count: 1
Total: 5.120000, Delta: 0.000000, Index found at OID: '.1.3.6.1.4.1.17713.20.2.1.4.2.0' value: 'CPE7000'
Total: 5.120000, Delta: 0.000000, index_parse at OID: '.1.3.6.1.4.1.17713.20.2.1.4.2.0' results: '.1.3.6.1.4.1.17713.20.2.1.4.2.0'  <<---- all OID index !!
Total: 5.120000, Delta: 0.000000, Inserting index data for field 'Index' [value='.1.3.6.1.4.1.17713.20.2.1.4.2.0']
Total: 5.120000, Delta: 0.000000, Update data query sort cache complete
Total: 5.120000, Delta: 0.000000, Updated data query index ordering
Total: 5.360000, Delta: 0.230000, Update re-index cache complete
Total: 5.360000, Delta: 0.000000, Update graph data query cache complete
Total: 5.360000, Delta: 0.000000, Update data source data query cache complete
Total: 5.360000, Delta: 0.000000, Update data query cache complete
Total: 5.360000, Delta: 0.000000, Update poller cache from query complete
Total: 5.360000, Delta: 0.000000, Automation execute data query complete
Total: 5.360000, Delta: 0.000000, Plugin hooks complete


EDIT:

Well i fixed my problem by deleting this line : <oid_index_parse>OID/REGEXP:^.{30}(.*)$</oid_index_parse>
Now i have the good string for Index :)

Code:
Total: 0.000000, Delta: 0.000000, Running data query [73].
Total: 0.000000, Delta: 0.000000, Found type = '3' [SNMP Query].
Total: 0.000000, Delta: 0.000000, Found data query XML file at '/usr/local/share/cacti/resource/snmp_queries/telrad7000-radio.xml'
Total: 0.000000, Delta: 0.000000, XML file parsed ok.
Total: 0.000000, Delta: 0.000000, <oid_num_indexes> missing in XML file, 'Index Count Changed' emulated by counting oid_index entries
Total: 5.240000, Delta: 5.240000, Executing SNMP walk for list of indexes @ '.1.3.6.1.4.1.17713.20.2.1.4.2.0' Index Count: 1
Total: 5.240000, Delta: 0.000000, Index found at OID: '.1.3.6.1.4.1.17713.20.2.1.4.2.0' value: 'CPE7000'
Total: 5.240000, Delta: 0.000000, Inserting index data for field 'Index' [value='CPE7000']
Total: 5.250000, Delta: 0.000000, Update data query sort cache complete
Total: 5.250000, Delta: 0.000000, Updated data query index ordering
Total: 5.530000, Delta: 0.280000, Update re-index cache complete
Total: 5.530000, Delta: 0.000000, Update graph data query cache complete
Total: 5.530000, Delta: 0.000000, Update data source data query cache complete
Total: 5.530000, Delta: 0.000000, Update data query cache complete
Total: 5.530000, Delta: 0.000000, Update poller cache from query complete
Total: 5.530000, Delta: 0.000000, Automation execute data query complete
Total: 5.530000, Delta: 0.000000, Plugin hooks complete


Top
 Profile  
 
 Post subject: Re: XML parse STRING from OID to set ITEMS - Telrad 7000
PostPosted: Mon Nov 12, 2018 4:51 am 
Offline
Cacti Guru User

Joined: Sun Aug 27, 2017 12:05 am
Posts: 2067
Good to hear!

_________________
Official Cacti Developer

Cacti Resources:
Cacti Website (including releases)
Cacti Issues
Cacti Development Releases
Cacti Development Documentation

My resources:
How to submit Pull Requests
Development Wiki and How To's
Updated NetSNMP Memory template for Cacti 1.x
Cisco SFP template for Cacti 0.8.8


Top
 Profile  
 
 Post subject: Re: XML parse STRING from OID to set ITEMS - Telrad 7000
PostPosted: Tue Nov 13, 2018 5:56 am 
Offline

Joined: Mon Mar 05, 2018 5:41 am
Posts: 15
Hi netniV,

Thank you :) now I'm facing to another problem.
I'm trying to make a graph for Device Uptime but the result from snmpget is like this : SNMPv2-SMI::enterprises.17713.20.2.1.5.18.0 = STRING: "0 days 7 hours 10 minutes" and I can't manage it to display something readable...

If I set my graph to 'Exact Numbers' I get this value : 710

Here is some examples :
0 days 7 hours 1 minutes -> 71
0 days 7 hours 10 minutes -> 710
0 days 7 hours 23 minutes -> 723
1 days 14 hours 54 minutes -> 11454
1 days 15 hours 4 minutes -> 1154

Can you help me to make something like that please ?
Source : https://forums.cacti.net/viewtopic.php?f=12&t=5951&start=19)

Thank you in advance for your support.

BR


Top
 Profile  
 
 Post subject: Re: XML parse STRING from OID to set ITEMS - Telrad 7000
PostPosted: Tue Nov 13, 2018 7:56 am 
Offline
Cacti Guru User

Joined: Sun Aug 27, 2017 12:05 am
Posts: 2067
Can you not utilise the normal SNMP uptime OID? The text description could be utilised but you would have to write a script server script to convert the value from text to numeric for it to be graphed.

_________________
Official Cacti Developer

Cacti Resources:
Cacti Website (including releases)
Cacti Issues
Cacti Development Releases
Cacti Development Documentation

My resources:
How to submit Pull Requests
Development Wiki and How To's
Updated NetSNMP Memory template for Cacti 1.x
Cisco SFP template for Cacti 0.8.8


Top
 Profile  
 
 Post subject: Re: XML parse STRING from OID to set ITEMS - Telrad 7000
PostPosted: Tue Nov 13, 2018 7:57 am 
Offline
Cacti Guru User

Joined: Sun Aug 27, 2017 12:05 am
Posts: 2067
That would be http://oidref.com/1.3.6.1.2.1.1.3.0 I think or it's parent.

_________________
Official Cacti Developer

Cacti Resources:
Cacti Website (including releases)
Cacti Issues
Cacti Development Releases
Cacti Development Documentation

My resources:
How to submit Pull Requests
Development Wiki and How To's
Updated NetSNMP Memory template for Cacti 1.x
Cisco SFP template for Cacti 0.8.8


Top
 Profile  
 
 Post subject: Re: XML parse STRING from OID to set ITEMS - Telrad 7000
PostPosted: Tue Nov 13, 2018 9:31 am 
Offline

Joined: Mon Mar 05, 2018 5:41 am
Posts: 15
Hi netniV,

With this device (outdoor CPE) here is the informations from snmpget :

#snmpget -v 2c -c public @IP .1.3.6.1.4.1.17713.20.2.1.5.18.0
SNMPv2-SMI::enterprises.17713.20.2.1.5.18.0 = STRING: "0 days 2 hours 9 minutes"

#snmpget -v 2c -c public @IP .1.3.6.1.2.1.1.3.0
DISMAN-EVENT-MIB::sysUpTimeInstance = Timeticks: (2121992916) 245 days, 14:25:29.16

So i can't take the default SNMP sysUpTimeInstance value :(

If you have another option I'm a taker :) thx


Top
 Profile  
 
 Post subject: Re: XML parse STRING from OID to set ITEMS - Telrad 7000
PostPosted: Tue Nov 13, 2018 5:53 pm 
Offline
Cacti Guru User

Joined: Sun Aug 27, 2017 12:05 am
Posts: 2067
Do you get the same if you drop the last .0 off the instance OID?

_________________
Official Cacti Developer

Cacti Resources:
Cacti Website (including releases)
Cacti Issues
Cacti Development Releases
Cacti Development Documentation

My resources:
How to submit Pull Requests
Development Wiki and How To's
Updated NetSNMP Memory template for Cacti 1.x
Cisco SFP template for Cacti 0.8.8


Top
 Profile  
 
 Post subject: Re: XML parse STRING from OID to set ITEMS - Telrad 7000
PostPosted: Wed Nov 14, 2018 5:10 am 
Offline

Joined: Mon Mar 05, 2018 5:41 am
Posts: 15
netniV wrote:
Do you get the same if you drop the last .0 off the instance OID?


If I try to drop the last .0 here is the result :

"No Such Instance currently exists at this OID"

Thank you for your support.

BR


Top
 Profile  
 
 Post subject: Re: XML parse STRING from OID to set ITEMS - Telrad 7000
PostPosted: Wed Nov 14, 2018 6:01 am 
Offline
Cacti Guru User

Joined: Sun Aug 27, 2017 12:05 am
Posts: 2067
OK, out of curiosity, if you do the original walk again, what value do you get now?

_________________
Official Cacti Developer

Cacti Resources:
Cacti Website (including releases)
Cacti Issues
Cacti Development Releases
Cacti Development Documentation

My resources:
How to submit Pull Requests
Development Wiki and How To's
Updated NetSNMP Memory template for Cacti 1.x
Cisco SFP template for Cacti 0.8.8


Top
 Profile  
 
 Post subject: Re: XML parse STRING from OID to set ITEMS - Telrad 7000
PostPosted: Wed Nov 14, 2018 7:32 am 
Offline

Joined: Mon Mar 05, 2018 5:41 am
Posts: 15
I attached the capture of the MIB for this device Telrad CPE 7000. If I do a search with app like MIB Browser, it's onlys the one occurence for uptime.


Attachments:
Capture.PNG
Capture.PNG [ 49.71 KiB | Viewed 152 times ]
Top
 Profile  
 
 Post subject: Re: XML parse STRING from OID to set ITEMS - Telrad 7000
PostPosted: Wed Nov 14, 2018 11:12 am 
Offline
Cacti Guru User

Joined: Sun Aug 27, 2017 12:05 am
Posts: 2067
Um, that wasn't what I asked for ;-)

_________________
Official Cacti Developer

Cacti Resources:
Cacti Website (including releases)
Cacti Issues
Cacti Development Releases
Cacti Development Documentation

My resources:
How to submit Pull Requests
Development Wiki and How To's
Updated NetSNMP Memory template for Cacti 1.x
Cisco SFP template for Cacti 0.8.8


Top
 Profile  
 
 Post subject: Re: XML parse STRING from OID to set ITEMS - Telrad 7000
PostPosted: Thu Nov 15, 2018 2:15 am 
Offline

Joined: Mon Mar 05, 2018 5:41 am
Posts: 15
Sorry, can you explain me what do you want exactly, please ? :)


Top
 Profile  
 
 Post subject: Re: XML parse STRING from OID to set ITEMS - Telrad 7000
PostPosted: Thu Nov 15, 2018 6:53 am 
Offline
Cacti Guru User

Joined: Sun Aug 27, 2017 12:05 am
Posts: 2067
oijkn wrote:
Hi netniV,

With this device (outdoor CPE) here is the informations from snmpget :

#snmpget -v 2c -c public @IP .1.3.6.1.4.1.17713.20.2.1.5.18.0
SNMPv2-SMI::enterprises.17713.20.2.1.5.18.0 = STRING: "0 days 2 hours 9 minutes"

#snmpget -v 2c -c public @IP .1.3.6.1.2.1.1.3.0
DISMAN-EVENT-MIB::sysUpTimeInstance = Timeticks: (2121992916) 245 days, 14:25:29.16

So i can't take the default SNMP sysUpTimeInstance value :(

If you have another option I'm a taker :) thx

Repeat this a few times over an hour so I can see the results.

_________________
Official Cacti Developer

Cacti Resources:
Cacti Website (including releases)
Cacti Issues
Cacti Development Releases
Cacti Development Documentation

My resources:
How to submit Pull Requests
Development Wiki and How To's
Updated NetSNMP Memory template for Cacti 1.x
Cisco SFP template for Cacti 0.8.8


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 20 posts ]  Go to page 1, 2  Next

All times are UTC - 5 hours


Who is online

Users browsing this forum: rajkayshap and 4 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