Search Exchange

Search All Sites

Nagios Live Webinars

Let our experts show you how Nagios can help your organization.

Contact Us

Phone: 1-888-NAGIOS-1
Email: sales@nagios.com

Login

Remember Me

Directory Tree

check_mikrotik_mem

Current Version
1.1
Last Release Date
2011-05-24
Compatible With
  • Nagios 3.x
License
GPL
Hits
110586
Files:
FileDescription
check_mikrotik_memcheck_mikrotik_mem
Nagios CSP

Meet The New Nagios Core Services Platform

Built on over 25 years of monitoring experience, the Nagios Core Services Platform provides insightful monitoring dashboards, time-saving monitoring wizards, and unmatched ease of use. Use it for free indefinitely.

Monitoring Made Magically Better

  • Nagios Core on Overdrive
  • Powerful Monitoring Dashboards
  • Time-Saving Configuration Wizards
  • Open Source Powered Monitoring On Steroids
  • And So Much More!
check_mikrotik_mem
This plugin checks memory status and returns usage in percent.
Setting up mikrotik:
Setting up a snmp v3 on mikrotik (works properly only with RouterOS v4.4 or greater):

snmp set enabled=yes contact=wifi@example.com location=Main_Building;
snmp community add name=monitoring security=private authentication-protocol=SHA authentication-password=SecretPasswd encryption-protocol=DES encryption-password=AnotherSecretPasswd read-access=yes address=192.168.1.1

Passwords must be min 8 chars long.

Installing check_mikrotik_mem plugin:
Download the plugin and save it to nagios plugins directory.

Set file permissions:
chown nagios:nagios check_mikrotik_mem
chmod 740 check_mikrotik_mem

Add following lines into your commands.cfg file
# 'check_mikrotik_mem' command definition
define command{
command_name check_mikrotik_mem
command_line $USER2$/check_mikrotik_mem -H $HOSTADDRESS$ $ARG1$
}

Add following lines into your resource.cfg file
# Store some usernames and passwords (hidden from the CGIs)
$USER3$=monitoring
$USER4$=SecretPasswd
$USER5$=AnotherSecretPasswd

Define new service for your devices.
define service{
use generic-service ; Inherit values from a template
hostgroup_name aps ; Apply to all our APs
service_description Memory usage.
check_command check_mikrotik_mem!-P 3 -L authPriv -U $USER3$ -a SHA -A $USER4$ -x DES -X $USER5$
}
Reviews (3)
Hi there, I'm getting a weird error and I still don't know what is causing it.
I installed the plugin and it returns results but only in the terminal like this:
[root@localhost libexec]# ./check_mikrotik_mem -H 192.168.0.254
SNMP OK - Using 38% of the total 1894MB memory. | data=38

But in Nagios it's giving me this error:
(No output on stdout) stderr: /usr/local/nagios/libexec/check_mikrotik_mem: line 179: snmpget: command not found

But I have net-snmp-5.7.2.1 installed and the check_snmp plugin is working without any problems.

I just don't know why is giving me an error in Nagios but not in the terminal...strange

Hope you can help me, thanks in advance :)

Best regards
I also needed to update the OIDs in the script, thanks for cyberef for doing the leg work on this.
bycyberef, October 18, 2012
1 of 1 people found this review helpful
Works great but I had to change the OID values. I guess they changed it in the latest version.

memtotal=$(snmpget $community$authproto$authpassword$privpasswd$protocol$secname$seclevel$privproto -Oqv $Host .1.3.6.1.2.1.25.2.3.1.5.65536)

memused=$(snmpget $community$authproto$authpassword$privpasswd$protocol$secname$seclevel$privproto -Oqv $Host .1.3.6.1.2.1.25.2.3.1.6.65536)