graph Unit Error

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
lamin
Posts: 177
Joined: Thu Oct 28, 2010 6:59 am

graph Unit Error

Post by lamin »

Hello There,
the performance graph does not display a correct unit. See attachments.
You do not have the required permissions to view the files attached to this post.
User avatar
nscott
Posts: 1040
Joined: Wed May 11, 2011 8:54 am

Re: Grapah Unit Error

Post by nscott »

lamin, what version are you running? There was a bug found in the mrtgtraf template that might apply to your situation.
Nicholas Scott
Former Nagios employee
lamin
Posts: 177
Joined: Thu Oct 28, 2010 6:59 am

Re: Grapah Unit Error

Post by lamin »

I am running Nagios XI 2011R1.1.
User avatar
nscott
Posts: 1040
Joined: Wed May 11, 2011 8:54 am

Re: Grapah Unit Error

Post by nscott »

Make a backup of your /usr/local/nagios/share/pnp/templates/check_xi_service_mrtgtraf.php and replace it with the attached file.

Keep in mind you will have to rename the attached file to check_xi_service_mrtgtraf.php as I can't attach .php files to the forum so I had to rename it to .txt

http://support.nagios.com/forum/downloa ... php?id=806
Nicholas Scott
Former Nagios employee
lamin
Posts: 177
Joined: Thu Oct 28, 2010 6:59 am

Re: Grapah Unit Error

Post by lamin »

Thanks and it is working.
Is there a way to monitor logs files with nagiosxi? To be more precise, I want to monitor the number of files in a directory. For instance, if the number of files > 200 then it is critical
User avatar
nscott
Posts: 1040
Joined: Wed May 11, 2011 8:54 am

Re: Grapah Unit Error

Post by nscott »

lamin,

There currently is nothing for that exact purpose, but I think something like this will definitely get you started if you're familiar with the Linux shell:

Code: Select all

#!/bin/sh

if [ ! "$1" ];then
        echo "UNKNOWN: Improper Arguments"
        exit 3
fi

total=$(ls -f "$1" | wc -w)

if [ ! "$3" ] && [ ! "$2" ];then
        echo "OK: $total files exist in $1"
else
        if [ $total -gt "$3" ];then
                echo "CRITICAL: More than $3 files in $1"
                exit 2
        elif [ $total -gt "$2" ];then
                echo "WARNING: More than $2 files in $1"
                exit 1
        else
                echo "OK: $total files in $1"
                exit 0
        fi
fi
This is a raw plugin that takes these args:

./nameofplugin <directory> <optional warning> <optional critical>

So I would have to copy all of this text into a text file called filecount.sh. Then make it executable, then run it like so:

./filecount.sh "/tmp" 30 40

This will count the file objects in the directory /tmp and will return critical if there are more than 40, warning if more than 30. Feel free to take this code and make it your own.
Nicholas Scott
Former Nagios employee
lamin
Posts: 177
Joined: Thu Oct 28, 2010 6:59 am

Re: Grapah Unit Error

Post by lamin »

Thanks dude, but I am nolt familiar with shell script. However, I have found something called check_dior-3.0.0.tar. According to them it work with nagiosxi and it will do the job. Can you please validate that because I want to certain?

Thanks
User avatar
nscott
Posts: 1040
Joined: Wed May 11, 2011 8:54 am

Re: Grapah Unit Error

Post by nscott »

lamin,

If the plugin works with Nagios Core, it will work for Nagios XI for sure! If you'd like a guide on using plugins off the exchange with nagios XI, this doc is quite handy!

http://assets.nagios.com/downloads/nagi ... lugins.pdf
Nicholas Scott
Former Nagios employee
lamin
Posts: 177
Joined: Thu Oct 28, 2010 6:59 am

Re: Grapah Unit Error

Post by lamin »

I am trying to monitor the directory using check_dir but I am getting some errors. Here is the definition. What am I doing wrong?

define service {
# host_name DTW-VAN-APP2
# service_description File Count
# use check_dir
# check_command $USER1$/check_dir -d D:\Program Files\Compuware\ServerVantage\Upload -w 300 -c 400 600
# max_check_attempts 5
# check_interval 5
# retry_interval 1
# check_period xi_timeperiod_24x7
# notification_interval 60
# notification_period xi_timeperiod_24x7
# contacts nagiosadmin
# contact_groups VantageGroup
# _xiwizard windowsserver
# register 1
# }
User avatar
nscott
Posts: 1040
Joined: Wed May 11, 2011 8:54 am

Re: Grapah Unit Error

Post by nscott »

Lamin,

It looks like you're trying to monitor a Windows directory? You will definitely need to use an agent like NSClient++. I assume since you're trying to monitor Windows, you're probably already successfully monitoring a Windows environment. Look at the services for the other Windows services (that are currently working) and see how they are doing the check. This should lead you in the proper direction in that regard. Also, you will definitely want to wrap the D:\...\ServerVantage\Upload directory string in quotes. And use forward slashes for that.

Also keep in mind NSClient++ will need to be configured with this plugin. You'll need to install that perl script on the Windows machine. Then add the check command in NSClient++, which is somewhat documented here:

http://www.nsclient.org/nscp/wiki/Check ... al_scripts

And then add the service using check_nrpe in Nagios. So its a bit of a busy process to add.
Nicholas Scott
Former Nagios employee