Closed OG2K closed 3 years ago
There is no --regexp true/false. Just writing "--regexp" means: the argument of --name is to be treated as a regular expression. Without this, the argument is compared 1:1 with the interface names.
Dear Lausser,
It is how icinga generates values for boolean custom variables. Hopefully, this resolution will be useful for others in future.
$ '/usr/lib64/nagios/plugins/check_nwc_health' '--regexp' '--hostname' 'xxx.xxx.xxx.xxx' '--community' 'xxx' '--mode' 'interface-st
atus' '--name' 'Ethernet1/(?1|4|13|16|25|28)' '--multiline'
Mode interface-status is not implemented for this type of device
and removing '--regexp' 'false' did solved an issue:
$ '/usr/lib64/nagios/plugins/check_nwc_health' '--hostname' 'xxx.xxx.xxx.xxx' '--community' 'xxx' '--mode' 'interface-status' '--nam
e' 'Ethernet1/1' '--multiline'
OK - Ethernet1/1 (alias xxx) is up/up
So, I need to modify in icinga given arguments to command by removing boolean "use regexp" and passing additional argument to command, which will be "--regexp". Presence of '--regexp' 'false' told script to use regexp feature and 'false' was ignored.
Good, second question resolved.
1a) Will it be possible to use regexp with Cisco Nexus 9000 series? 1b) cosmetic note, regarding misleading message.
BR /A
Ethernet1/... The slash might break something. The plugin is written in Perl and a slash must be escaped, because internally it is used as some kind of delimiter. if ($interface_name =~ /$regexp/) ..... Regular expressions in Perl are surrounded by /, so you must write 'Ethernet1\/(?1|4|13|16|25|28)'
it works properly with other network devices. I run as you adviced, got same error message
Mode interface-status is not implemented for this type of device
Might it be affected with Cisco OS ?
# sh version
Cisco Nexus Operating System (NX-OS) Software
TAC support: http://www.cisco.com/tac
[...]
Software
BIOS: version 05.39
NXOS: version 9.3(3)
BIOS compile time: 08/30/2019
NXOS image file is: bootflash:///nxos.9.3.3.bin
NXOS compile time: 12/22/2019 2:00:00 [12/22/2019 17:00:37]
Hardware
cisco Nexus9000 C93180YC-FX Chassis
Intel(R) Xeon(R) CPU D-1528 @ 1.90GHz with 65808192 kB of memory.
Processor Board ID xxx
Device name: xxx
bootflash: 115805356 kB
Kernel uptime is 298 day(s), 5 hour(s), 41 minute(s), 0 second(s)
Last reset at 851206 usecs after Sun Feb 9 10:27:08 2020
Reason: Power Down/UP epld upgrade process
System version: 9.3(3)
Service: Power Down/UP epld upgrade process
plugin
Core Plugin, Ethernet Plugin
Dears,
I am facing issue with checking interface-status on Cisco Nexus 9000 series giving an regexp argument as follows:
Output message is misleading, because inteface-status works, but without regexp argument.
After failure, it was decided to create several different checks, but faced another issue: tried determine which interface to check, script will output all interfaces which contain Ethernet1/1 in it:
My questions are: 1) Am I doing something wrong enabling regexp feature for this particular switch model? if yes, what it could be? 2) How do I specify particular interface to check?
Wishing everybody to be safe, BR /A