[SOLVED] Graph Uptime on Telrad 7000

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

Moderators: Moderators, Developers

Author
Message
oijkn
Posts: 15
Joined: Mon Mar 05, 2018 5:41 am

[SOLVED] Graph Uptime on Telrad 7000

#1 Post by oijkn » Mon Mar 05, 2018 7:45 am

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: 2656
Joined: Sun Aug 27, 2017 12:05 am

Re: XML parse STRING from OID to set ITEMS

#2 Post by netniV » Thu Mar 08, 2018 5:01 am

If I'm reading that rightly, your index parse is saying to find .31. which isn't present in the output above.

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

Re: XML parse STRING from OID to set ITEMS

#3 Post by oijkn » Fri Nov 09, 2018 6:17 am

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


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

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

#5 Post by oijkn » Tue Nov 13, 2018 5:56 am

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: 2656
Joined: Sun Aug 27, 2017 12:05 am

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

#6 Post by netniV » Tue Nov 13, 2018 7:56 am

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.


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

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

#8 Post by oijkn » Tue Nov 13, 2018 9:31 am

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: 2656
Joined: Sun Aug 27, 2017 12:05 am

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

#9 Post by netniV » Tue Nov 13, 2018 5:53 pm

Do you get the same if you drop the last .0 off the instance OID?

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

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

#10 Post by oijkn » Wed Nov 14, 2018 5:10 am

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: 2656
Joined: Sun Aug 27, 2017 12:05 am

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

#11 Post by netniV » Wed Nov 14, 2018 6:01 am

OK, out of curiosity, if you do the original walk again, what value do you get now?

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

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

#12 Post by oijkn » Wed Nov 14, 2018 7:32 am

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 486 times


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

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

#14 Post by oijkn » Thu Nov 15, 2018 2:15 am

Sorry, can you explain me what do you want exactly, please ? :)

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

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

#15 Post by netniV » Thu Nov 15, 2018 6:53 am

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.

Post Reply