[SOLVED] Graph Uptime on Telrad 7000

Templates, scripts for templates, scripts and requests for templates.

Moderators: Developers, Moderators

oijkn
Posts: 18
Joined: Mon Mar 05, 2018 5:41 am

[SOLVED] Graph Uptime on Telrad 7000

Post by oijkn »

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: Select all

<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: Select all

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: Select all

<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: Select all

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) 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.
netniV
Cacti Guru User
Posts: 3440
Joined: Sun Aug 27, 2017 12:05 am

Re: XML parse STRING from OID to set ITEMS

Post by netniV »

If I'm reading that rightly, your index parse is saying to find .31. which isn't present in the output above.
Cacti Developer & Release Manager
The Cacti Group

Director
BV IT Solutions Ltd

+--------------------------------------------------------------------------+

Cacti Resources:
Cacti Website (including releases)
Cacti Issues
Cacti Development Releases
Cacti Development Documentation
oijkn
Posts: 18
Joined: Mon Mar 05, 2018 5:41 am

Re: XML parse STRING from OID to set ITEMS

Post by oijkn »

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: Select all

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: Select all

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
netniV
Cacti Guru User
Posts: 3440
Joined: Sun Aug 27, 2017 12:05 am

Re: XML parse STRING from OID to set ITEMS - Telrad 7000

Post by netniV »

Good to hear!
Cacti Developer & Release Manager
The Cacti Group

Director
BV IT Solutions Ltd

+--------------------------------------------------------------------------+

Cacti Resources:
Cacti Website (including releases)
Cacti Issues
Cacti Development Releases
Cacti Development Documentation
oijkn
Posts: 18
Joined: Mon Mar 05, 2018 5:41 am

Re: XML parse STRING from OID to set ITEMS - Telrad 7000

Post by oijkn »

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 : viewtopic.php?f=12&t=5951&start=19)

Thank you in advance for your support.

BR
netniV
Cacti Guru User
Posts: 3440
Joined: Sun Aug 27, 2017 12:05 am

Re: XML parse STRING from OID to set ITEMS - Telrad 7000

Post by netniV »

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.
Cacti Developer & Release Manager
The Cacti Group

Director
BV IT Solutions Ltd

+--------------------------------------------------------------------------+

Cacti Resources:
Cacti Website (including releases)
Cacti Issues
Cacti Development Releases
Cacti Development Documentation
netniV
Cacti Guru User
Posts: 3440
Joined: Sun Aug 27, 2017 12:05 am

Re: XML parse STRING from OID to set ITEMS - Telrad 7000

Post by netniV »

That would be http://oidref.com/1.3.6.1.2.1.1.3.0 I think or it's parent.
Cacti Developer & Release Manager
The Cacti Group

Director
BV IT Solutions Ltd

+--------------------------------------------------------------------------+

Cacti Resources:
Cacti Website (including releases)
Cacti Issues
Cacti Development Releases
Cacti Development Documentation
oijkn
Posts: 18
Joined: Mon Mar 05, 2018 5:41 am

Re: XML parse STRING from OID to set ITEMS - Telrad 7000

Post by oijkn »

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
netniV
Cacti Guru User
Posts: 3440
Joined: Sun Aug 27, 2017 12:05 am

Re: XML parse STRING from OID to set ITEMS - Telrad 7000

Post by netniV »

Do you get the same if you drop the last .0 off the instance OID?
Cacti Developer & Release Manager
The Cacti Group

Director
BV IT Solutions Ltd

+--------------------------------------------------------------------------+

Cacti Resources:
Cacti Website (including releases)
Cacti Issues
Cacti Development Releases
Cacti Development Documentation
oijkn
Posts: 18
Joined: Mon Mar 05, 2018 5:41 am

Re: XML parse STRING from OID to set ITEMS - Telrad 7000

Post by oijkn »

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
netniV
Cacti Guru User
Posts: 3440
Joined: Sun Aug 27, 2017 12:05 am

Re: XML parse STRING from OID to set ITEMS - Telrad 7000

Post by netniV »

OK, out of curiosity, if you do the original walk again, what value do you get now?
Cacti Developer & Release Manager
The Cacti Group

Director
BV IT Solutions Ltd

+--------------------------------------------------------------------------+

Cacti Resources:
Cacti Website (including releases)
Cacti Issues
Cacti Development Releases
Cacti Development Documentation
oijkn
Posts: 18
Joined: Mon Mar 05, 2018 5:41 am

Re: XML parse STRING from OID to set ITEMS - Telrad 7000

Post by oijkn »

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 2282 times
netniV
Cacti Guru User
Posts: 3440
Joined: Sun Aug 27, 2017 12:05 am

Re: XML parse STRING from OID to set ITEMS - Telrad 7000

Post by netniV »

Um, that wasn't what I asked for ;-)
Cacti Developer & Release Manager
The Cacti Group

Director
BV IT Solutions Ltd

+--------------------------------------------------------------------------+

Cacti Resources:
Cacti Website (including releases)
Cacti Issues
Cacti Development Releases
Cacti Development Documentation
oijkn
Posts: 18
Joined: Mon Mar 05, 2018 5:41 am

Re: XML parse STRING from OID to set ITEMS - Telrad 7000

Post by oijkn »

Sorry, can you explain me what do you want exactly, please ? :)
netniV
Cacti Guru User
Posts: 3440
Joined: Sun Aug 27, 2017 12:05 am

Re: XML parse STRING from OID to set ITEMS - Telrad 7000

Post by netniV »

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.
Cacti Developer & Release Manager
The Cacti Group

Director
BV IT Solutions Ltd

+--------------------------------------------------------------------------+

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

Who is online

Users browsing this forum: No registered users and 2 guests