Kernel Module Check for Nagios

By | 31 Mar 2014

mod_loaded:

#!/bin/sh
if [ "$1" = "" ]
then
        echo "USAGE:"
        echo "$0 <kernel-mod>"
        exit 99
fi

MOD=$1

STATUS=`lsmod | grep "$MOD"`
if [ -z "$STATUS" ]; then
        echo "CRITICAL - Kernel module $MOD not loaded!"
        exit 2
fi

DATA=( $STATUS )

echo "OK - ${DATA[0]} has ${DATA[2]} instances, ${DATA[1]} bytes.|instances=${DATA[2]}, memory_usage=${DATA[1]}"
exit 0Code language: PHP (php)

For Check_MK add this to the /etc/check_mk/mrpe.cfg:

DigiPort_KernelMod      /usr/local/nagios/plugins/mod_loaded dgrp

Leave a Reply

Your email address will not be published. Required fields are marked *

To respond on your own website, enter the URL of your response which should contain a link to this post's permalink URL. Your response will then appear (possibly after moderation) on this page. Want to update or remove your response? Update or delete your post and re-enter your post's URL again. (Find out more about Webmentions.)