Listing the routing OSPF mikrotik

An open discussion forum for obtaining help with Nagios Core. Nagios Core users of all experience levels are welcome here. Subforum have been created for the discussion of Nagios Core and Nagios Plugin development.

NOTE: The SourceForge.net mailing lists have been deprecated in favor of this forum in order to expedite support and provide additional features not available on the old mailing list.

Listing the routing OSPF mikrotik

Postby pintu » Thu Jan 03, 2019 8:28 am

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/Plugins/Network-Protocols/OSPF/check_ospf2/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.
pintu
 
Posts: 19
Joined: Fri Jun 09, 2017 6:33 am

Re: Listing the routing OSPF mikrotik

Postby scottwilkerson » Thu Jan 03, 2019 9:23 am

How are you trying to run the plugin? With what arguments?
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
User avatar
scottwilkerson
DevOps Engineer
 
Posts: 15020
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises

Re: Listing the routing OSPF mikrotik

Postby pintu » Tue Jan 08, 2019 11:07 am

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
pintu
 
Posts: 19
Joined: Fri Jun 09, 2017 6:33 am

Re: Listing the routing OSPF mikrotik

Postby scottwilkerson » Tue Jan 08, 2019 12:13 pm

should be
Code: Select all
./check_ospf.0.1.pl -H Hostaddress -C public -v v2c
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
User avatar
scottwilkerson
DevOps Engineer
 
Posts: 15020
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises

Re: Listing the routing OSPF mikrotik

Postby pintu » Wed Jan 09, 2019 5:54 am

./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).
pintu
 
Posts: 19
Joined: Fri Jun 09, 2017 6:33 am

Re: Listing the routing OSPF mikrotik

Postby scottwilkerson » Wed Jan 09, 2019 9:19 am

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
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
User avatar
scottwilkerson
DevOps Engineer
 
Posts: 15020
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises

Re: Listing the routing OSPF mikrotik

Postby pintu » Fri Jan 11, 2019 5:04 pm

./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
pintu
 
Posts: 19
Joined: Fri Jun 09, 2017 6:33 am

Re: Listing the routing OSPF mikrotik

Postby scottwilkerson » Fri Jan 11, 2019 5:57 pm

You would need to also pass the peer per the usage
Code: Select all
-p <peer>
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
User avatar
scottwilkerson
DevOps Engineer
 
Posts: 15020
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises

Re: Listing the routing OSPF mikrotik

Postby pintu » Mon Jan 14, 2019 5:31 am

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)) {
pintu
 
Posts: 19
Joined: Fri Jun 09, 2017 6:33 am

Re: Listing the routing OSPF mikrotik

Postby scottwilkerson » Mon Jan 14, 2019 12:54 pm

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
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
User avatar
scottwilkerson
DevOps Engineer
 
Posts: 15020
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises

Next

Return to Nagios Core

Who is online

Users browsing this forum: galeman and 24 guests