VALUE/REGEXP in XML appears as "U" in SPINE logs ( issue #1252 ?? )

Post general support questions here that do not specifically fall into the Linux or Windows categories.

Moderators: Developers, Moderators

Post Reply
ntrazivuk
Posts: 6
Joined: Thu Nov 07, 2019 6:49 am

VALUE/REGEXP in XML appears as "U" in SPINE logs ( issue #1252 ?? )

Post by ntrazivuk »

Hello guys,

I am new to Cacti administration and to this forum, so please forgive if this has already been explained somewhere.
I am trying to setup monitoring of optical levels on 40G/100G SFPs on Huawei routers. Snmp OID returns 4 Rx values, one for each lane (that are later divided by 100 with CDEF function):

SNMPv2-SMI::enterprises.2011.5.25.31.1.1.3.1.32.16847105 = STRING: "-121,-270,-146,-175"

I 've created xml file with VALUE/REGEXP to filter out the value for each of the lanes and later store it to different data sources (attached).
40GRxTxbackup.xml
(2.57 KiB) Downloaded 60 times
When I perform verbose data query using that xml, I am seeing the following (ie lane 2):

Found item [ifRxOptLane2='-270 (-120,-270,-145,-175)'] index: 16847105 [from regexp value parse]
Found item [ifRxOptLane2='104 (81,104,144,132)'] index: 16847106 [from regexp value parse]
Found item [ifRxOptLane2='-117 (-69,-117,-71,-27)'] index: 16847361 [from regexp value parse]
Found item [ifRxOptLane2='-450 (-569,-450,-476,-455)'] index: 16847362 [from regexp value parse]
Found item [ifRxOptLane2='-1 (-14,-1,-47,22)'] index: 17174785 [from regexp value parse]
Found item [ifRxOptLane2='6 (-5,6,-10,-25)'] index: 17174786 [from regexp value parse]
Found item [ifRxOptLane2='159 (203,159,105,182)'] index: 17175041 [from regexp value parse]
Found item [ifRxOptLane2='-277 (-263,-277,-333,-117)'] index: 17175042 [from regexp value parse]
Found item [ifRxOptLane2='-4 (0,-4,-6,-37)'] index: 17240321 [from regexp value parse]
Found item [ifRxOptLane2='15 (-45,15,6,13)'] index: 17240322 [from regexp value parse]
Found item [ifRxOptLane2='-110 (-35,-110,-131,-197)'] index: 17240577 [from regexp value parse]
Found item [ifRxOptLane2='-587 (-403,-587,-448,-452)'] index: 17240578 [from regexp value parse]

I am not sure if this is working as expected, because the original values are still present in parentheses.
Weird thing is that this regexp works with the opposite logic than OID regex, so I had to catch all the values that I want to remove from my result.

Anyhow, my graphs are not working and I am seeing undefined values in data sources, please see the log:

2019/11/07 11:30:08 - SPINE: Poller[1] PID[30138] Device[459] HT[1] DS[12382] SNMP: v2: [ip address omitted], dsname: 40g_rx_lane1, oid: .1.3.6.1.4.1.2011.5.25.31.1.1.3.1.32.17240322, value: U
2019/11/07 11:30:08 - SPINE: Poller[1] PID[30138] Device[459] HT[1] DS[12382] SNMP: v2: [ip address omitted], dsname: 40g_rx_lane2, oid: .1.3.6.1.4.1.2011.5.25.31.1.1.3.1.32.17240322, value: U
2019/11/07 11:30:08 - SPINE: Poller[1] PID[30138] Device[459] HT[1] DS[12382] SNMP: v2: [ip address omitted], dsname: 40g_rx_lane3, oid: .1.3.6.1.4.1.2011.5.25.31.1.1.3.1.32.17240322, value: U
2019/11/07 11:30:08 - SPINE: Poller[1] PID[30138] Device[459] HT[1] DS[12382] SNMP: v2: [ip address omitted], dsname: 40g_rx_lane4, oid: .1.3.6.1.4.1.2011.5.25.31.1.1.3.1.32.17240322, value: U
2019/11/07 11:35:11 - SPINE: Poller[1] PID[30402] Device[459] HT[1] DS[12382] SNMP: v2: [ip address omitted], dsname: 40g_rx_lane1, oid: .1.3.6.1.4.1.2011.5.25.31.1.1.3.1.32.17240322, value: U
2019/11/07 11:35:11 - SPINE: Poller[1] PID[30402] Device[459] HT[1] DS[12382] SNMP: v2: [ip address omitted], dsname: 40g_rx_lane2, oid: .1.3.6.1.4.1.2011.5.25.31.1.1.3.1.32.17240322, value: U
2019/11/07 11:35:11 - SPINE: Poller[1] PID[30402] Device[459] HT[1] DS[12382] SNMP: v2: [ip address omitted], dsname: 40g_rx_lane3, oid: .1.3.6.1.4.1.2011.5.25.31.1.1.3.1.32.17240322, value: U
2019/11/07 11:35:11 - SPINE: Poller[1] PID[30402] Device[459] HT[1] DS[12382] SNMP: v2: [ip address omitted], dsname: 40g_rx_lane4, oid: .1.3.6.1.4.1.2011.5.25.31.1.1.3.1.32.17240322, value: U
2019/11/07 11:40:07 - SPINE: Poller[1] PID[30683] Device[459] HT[1] DS[12382] SNMP: v2: [ip address omitted], dsname: 40g_rx_lane1, oid: .1.3.6.1.4.1.2011.5.25.31.1.1.3.1.32.17240322, value: U
2019/11/07 11:40:07 - SPINE: Poller[1] PID[30683] Device[459] HT[1] DS[12382] SNMP: v2: [ip address omitted], dsname: 40g_rx_lane2, oid: .1.3.6.1.4.1.2011.5.25.31.1.1.3.1.32.17240322, value: U
2019/11/07 11:40:07 - SPINE: Poller[1] PID[30683] Device[459] HT[1] DS[12382] SNMP: v2: [ip address omitted], dsname: 40g_rx_lane3, oid: .1.3.6.1.4.1.2011.5.25.31.1.1.3.1.32.17240322, value: U
2019/11/07 11:40:07 - SPINE: Poller[1] PID[30683] Device[459] HT[1] DS[12382] SNMP: v2: [ip address omitted], dsname: 40g_rx_lane4, oid: .1.3.6.1.4.1.2011.5.25.31.1.1.3.1.32.17240322, value: U

I left the direction as input-output in the xml, so I can test the query.. However, I tried all combinations and it is not working.
Can someone please advise?
Thank you in advance!
Last edited by ntrazivuk on Thu Nov 14, 2019 8:08 am, edited 1 time in total.
ntrazivuk
Posts: 6
Joined: Thu Nov 07, 2019 6:49 am

Re: VALUE/REGEXP in XML appears as "U" in SPINE logs

Post by ntrazivuk »

If i wasnt clear enough, what I am trying to ask:

1) Why regex doesnt work as usual in my VALUE/REGEX functionality? It works the same with capturing () as well. Whatever is captured, it is deleted.
2) Is this normal output? :
Found item [ifRxOptLane2='-587 (-403,-587,-448,-452)'] index: 17240578 [from regexp value parse]

shouldn't it just be:
Found item [ifRxOptLane2='-587)'] index: 17240578 [from regexp value parse]

so without the original value in () ?

3) When I take a look at default xml file - interfaces.xml, I see that AdminStatus field uses VALUE/REGEXP:

<ifAdminStatus>
<name>AdminStatus</name>
<method>walk</method>
<source>VALUE/REGEXP:[a-zA-Z]{1,}\(([1-]{1})+\)$</source>
<direction>input-output</direction>
<oid>.1.3.6.1.2.1.2.2.1.7</oid>
</ifAdminStatus>

However, when I run verbose query on default "SNMP - Interface Statistics" which uses interface.xml, I dont see value taken from regexp for AdminStatus, but from the value itself:

Found item [ifAdminStatus='Up'] index: 1 [from value]
Found item [ifAdminStatus='Up'] index: 2 [from value]
Found item [ifAdminStatus='Up'] index: 3 [from value]
Found item [ifAdminStatus='Up'] index: 4 [from value]
Found item [ifAdminStatus='Up'] index: 7 [from value]
Found item [ifAdminStatus='Up'] index: 8 [from value]
Found item [ifAdminStatus='Up'] index: 97 [from value]
Found item [ifAdminStatus='Up'] index: 98 [from value]
Found item [ifAdminStatus='Up'] index: 99 [from value]
Found item [ifAdminStatus='Up'] index: 101 [from value]
Found item [ifAdminStatus='Up'] index: 103 [from value]
Found item [ifAdminStatus='Up'] index: 104 [from value]
Found item [ifAdminStatus='Up'] index: 105 [from value]
Found item [ifAdminStatus='Up'] index: 106 [from value]
Found item [ifAdminStatus='Up'] index: 107 [from value]
Found item [ifAdminStatus='Up'] index: 119 [from value]
Found item [ifAdminStatus='Up'] index: 120 [from value]
Found item [ifAdminStatus='Up'] index: 121 [from value]


Compared to my query where it says "from regexp value parse":

Found item [ifRxOptLane2='-110 (-35,-110,-131,-197)'] index: 17240577 [from regexp value parse]
Found item [ifRxOptLane2='-587 (-403,-587,-448,-452)'] index: 17240578 [from regexp value parse]



I am using cacti 1.2.6.
Maybe the problem is that my result is a string? I have seen examples on this forum where STRING type result was parsed and it worked (ie 1427 Kbytes -> strip off "Kbytes" and get the number only).
This post is from 2004! about4915.html

Any advice is highly appreciated, cause I have no idea where to look.
ntrazivuk
Posts: 6
Joined: Thu Nov 07, 2019 6:49 am

Re: VALUE/REGEXP in XML appears as "U" in SPINE logs

Post by ntrazivuk »

Anyone please?
ntrazivuk
Posts: 6
Joined: Thu Nov 07, 2019 6:49 am

Re: VALUE/REGEXP in XML appears as "U" in SPINE logs

Post by ntrazivuk »

I think I have the same issue as mentioned here :

https://github.com/Cacti/cacti/issues/1252

Where can I check if this has been resolved ?
Vasche
Posts: 9
Joined: Tue Oct 01, 2024 9:35 am

Re: VALUE/REGEXP in XML appears as "U" in SPINE logs ( issue #1252 ?? )

Post by Vasche »

i have the same issues,
you resolved? i create a script for the 100G but i need to have different OID to choice from the port but i dont know how to do
User avatar
macan
Cacti Guru User
Posts: 1106
Joined: Tue Mar 18, 2008 2:30 am
Location: Czech

Re: VALUE/REGEXP in XML appears as "U" in SPINE logs ( issue #1252 ?? )

Post by macan »

have a look here
https://docs.cacti.net/How-To-Script-Data-Queries.md

you can do in script anything what you want.
Let the Cacti grow!
Vasche
Posts: 9
Joined: Tue Oct 01, 2024 9:35 am

Re: VALUE/REGEXP in XML appears as "U" in SPINE logs ( issue #1252 ?? )

Post by Vasche »

sorry but I wasn't helped by this. if it is possible in some mood I would also be fine to pass some data to the script by writing it by hand.
Example: if I need oid 13123 in the script and it is possible to pass it to the script it would be perfect. Thank you
User avatar
macan
Cacti Guru User
Posts: 1106
Joined: Tue Mar 18, 2008 2:30 am
Location: Czech

Re: VALUE/REGEXP in XML appears as "U" in SPINE logs ( issue #1252 ?? )

Post by macan »

sorry wrong link. Correct https://docs.cacti.net/How-To-Create-Da ... -Method.md

I wrote you in another thread few advices
Let the Cacti grow!
Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests