I would like to use the string functions to make filters in my label.
I would like to do that, but I am almost sure that it is not possible, because I am in a ros_command
[Interface.Name]: [ros_command(":put ([interface ethernet monitor [Interface.Name] once as-value]->\"sfp-vendor-part-number\")")]
So, I would like to do it with "if" functions,
if [Interface.Name]=sfpplus1 then ros_command.... with sfpplus1
if [Interface.Name]=sfpplus2 then ros_command.... with sfpplus2
if [Interface.Name]=sfpplus3 then ros_command.... with sfpplus3
But I'm already stuck,
because none of my tests with the string functions work.
I have listed below, from 1 to 10
I also read on this forum, I have the impression that this problem has lasted for 10 years ...
Code: Select all
[snmp_wireless_link_info()]Rx: [Interface.InBitRate][snmp_wireless_link_rx_rate()]
Tx: [Interface.OutBitRate][snmp_wireless_link_tx_rate()]
[Interface.Name]: [ros_command(":put ([interface ethernet monitor sfpplus1 once as-value]->\"sfp-vendor-part-number\")")]
0-- [Interface.Name]
1-- [string_size("[Interface.Name]")] # not working
2-- [string_size([Interface.Name])] # not working
3-- [if("[Interface.Name]"="sfpplus1","OK","NOK")] # return alawys ok, why ?
4-- [if([Interface.Name]="sfpplus1","OK","NOK")]
5-- [if([Interface.Name]=sfpplus1,"OK","NOK")]
6-- [string_compare("[Interface.Name]","sfpplus1")] # work like size ? why?
7-- [string_compare([Interface.Name],sfpplus1)]
8-- [string_compare("azerty","azerty")] # Why doesnt return 0
9-- [string_find("azerty","azerty")] # work like compare
10-- [string_find([Interface.Name],[Interface.Name])] #not working
Thanks for your help.