Listing the routing OSPF mikrotik

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
pintu
Posts: 27
Joined: Fri Jun 09, 2017 6:33 am

Listing the routing OSPF mikrotik

Post by pintu »

I need to check the routing route in my mikrotik, Is there a path on OSPF 0.0.0.0?
I used this forum: https://forum.mikrotik.com/viewtopic.php?t=51835
I also downloaded check_ospf2 script (https://exchange.nagios.org/directory/P ... f2/details)
but I don't think I can use it because I have it all the time:

Code: Select all

check_ospf.pl v$Revision: 0.1 $  (nagios-plugins 2.2.1)
The nagios plugins come with ABSOLUTELY NO WARRANTY. You may redistribute
copies of the plugins under the terms of the GNU General Public License.
For more information about these matters, see the file named COPYING.
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Listing the routing OSPF mikrotik

Post by scottwilkerson »

How are you trying to run the plugin? With what arguments?
Former Nagios employee
Creator:
ahumandesign.com
enneagrams.com
pintu
Posts: 27
Joined: Fri Jun 09, 2017 6:33 am

Re: Listing the routing OSPF mikrotik

Post by pintu »

various, example:
./check_ospf.0.1.pl -H Hostaddress -C public -V 2 -p 161
./check_ospf.0.1.pl -H Hostaddress -C public -V SNMP v2c
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Listing the routing OSPF mikrotik

Post by scottwilkerson »

should be

Code: Select all

./check_ospf.0.1.pl -H Hostaddress -C public -v v2c
Former Nagios employee
Creator:
ahumandesign.com
enneagrams.com
pintu
Posts: 27
Joined: Fri Jun 09, 2017 6:33 am

Re: Listing the routing OSPF mikrotik

Post by pintu »

./check_ospf.0.1.pl -H Hostaddress -C public -V SNMP v2c

Code: Select all

Value "v2c" invalid for option v (number expected)
Usage:
  check_ospf.0.1.pl -H <HOSTNAME> [-C <community>] -p <peer>
  check_ospf.0.1.pl [-h | --help]
  check_ospf.0.1.pl [-V | --version]

Code: Select all

./check_ospf.0.1.pl -h
check_ospf.0.1.pl v$Revision: 0.1 $  (nagios-plugins 2.2.1)
The nagios plugins come with ABSOLUTELY NO WARRANTY. You may redistribute
copies of the plugins under the terms of the GNU General Public License.
For more information about these matters, see the file named COPYING.
Copyright (c) 2006 Larry Low
This program is licensed under the terms of the
GNU General Public License
(check source code for details)

Check OSPF peer status via SNMP.

Usage:
  check_ospf.0.1.pl -H <HOSTNAME> [-C <community>] -p <peer>
  check_ospf.0.1.pl [-h | --help]
  check_ospf.0.1.pl [-V | --version]

 -H (--hostname)     Hostname to query - (required)
 -C (--community)    SNMP read community or v3 auth (defaults to public)
                     (v3 specified as username:authpassword:... )
                       username = SNMPv3 security name
                       authpassword = SNMPv3 authentication pass phrase (or hexidecimal key)
                       authprotocol = SNMPv3 authentication protocol (md5 (default) or sha)
                       privpassword = SNMPv3 privacy pass phrase (or hexidecmal key)
                       privprotocol = SNMPv3 privacy protocol (des (default) or aes)
 -v (--snmp_version) 1 for SNMP v1
                     2 for SNMP v2c (default)
                     3 for SNMP v3
 -p {--peer}         IP of peer
 -V (--version)      Plugin version
 -h (--help)         usage help

Send email to help@nagios-plugins.org if you have questions regarding use
of this software. To submit patches or suggest improvements, send email to
devel@nagios-plugins.org. Please include version information with all
correspondence (when possible, use output from the --version option of the
plugin itself).
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Listing the routing OSPF mikrotik

Post by scottwilkerson »

looking at the help again it should be

Code: Select all

./check_ospf.0.1.pl -H Hostaddress -C public -v 2
Sorry I can't test this because I don't have the equipment
Former Nagios employee
Creator:
ahumandesign.com
enneagrams.com
pintu
Posts: 27
Joined: Fri Jun 09, 2017 6:33 am

Re: Listing the routing OSPF mikrotik

Post by pintu »

./check_ospf.0.1.pl -H Hostaddress -C public -v 2
Usage:
check_ospf.0.1.pl -H <HOSTNAME> [-C <community>] -p <peer>
check_ospf.0.1.pl [-h | --help]
check_ospf.0.1.pl [-V | --version]
so I asked this forum how to check OSPF mikrotik
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Listing the routing OSPF mikrotik

Post by scottwilkerson »

You would need to also pass the peer per the usage

Code: Select all

-p <peer>
Former Nagios employee
Creator:
ahumandesign.com
enneagrams.com
pintu
Posts: 27
Joined: Fri Jun 09, 2017 6:33 am

Re: Listing the routing OSPF mikrotik

Post by pintu »

I've added

Code: Select all

./check_ospf.0.1.pl -H Hostaddress -C public -v 2 -p 192.168.1.0/24
I get:

Code: Select all

UNKNOWN: SNMP error: The OBJECT IDENTIFIER value "1.3.6.1.2.1.14.10.1.3.192.168.1.0/24.0" is expected in dotted decimal notatio
when typing without a subnet mask, then you will get:
./check_ospf.0.1.pl -H Hostaddress -C public -v 2 -p 192.168.1.0
Use of uninitialized value in concatenation (.) or string at ./check_ospf.0.1.pl line 141.
Argument "noSuchObject" isn't numeric in numeric eq (==) at ./check_ospf.0.1.pl line 143.
CRITICAL - 192.168.1.0 (Router ID noSuchObject) state is
Lines 141 i 143:

Code: Select all

                $output = "$peer (Router ID $ospfNbrRtrId) state is ".$ospfNbrStates{$ospfNbrState};

                if (($ospfNbrState == 4) || ($ospfNbrState == 8)) {
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Listing the routing OSPF mikrotik

Post by scottwilkerson »

This looks like your router isn't responding with a correct response for that OID

What version of Mikrotik are you using?

Can you run these replacing Hostaddress with your Mikrotik?

Code: Select all

snmpget -v 2c -c public Hostaddress .1.3.6.1.2.1.4.21.1.7.0.0.0.0
snmpget -v 2c -c public Hostaddress .1.3.6.1.2.1.4.21.1.7.192.168.1.0
Former Nagios employee
Creator:
ahumandesign.com
enneagrams.com
Locked