SearchFAQMemberlist Log in
Reply to topic Page 1 of 1
Nagios Plungin to check mount requests
Author Message
Post Nagios Plungin to check mount requests 
Does anyone have a nagios plugin that checks if bacula is waiting for
a mount request? I have seen ones that check if jobs fail or check if
the daemons are running but not one that checks if bacula is waiting
on a mount. Sometimes bacula wants a tape that is not in my 24 slot
autochanger and that puts jobs on hold until I notice that. I need
this because my linux network is not permitted to be connected to the
internet so I can not receive emails from bacula however all clients
have dual networks so I can monitor status using nagios on my desktop.

--
John M. Drescher

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and
threat landscape has changed and how IT managers can respond. Discussions
will include endpoint security, mobile security and the latest in malware
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Bacula-users mailing list
Bacula-users < at > lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bacula-users

View user's profile Send private message
Post Nagios Plungin to check mount requests 
Well....

I thing that is not so hard create a script that run a single command like bconsole <some parameter> and check the status of directory...
Is a simple question of study how to do that... and return a value to nagios

2012/8/2 John Drescher <drescherjm < at > gmail.com ([email]drescherjm < at > gmail.com[/email])>
Does anyone have a nagios plugin that checks if bacula is waiting for
a mount request? I have seen ones that check if jobs fail or check if
the daemons are running but not one that checks if bacula is waiting
on a mount. Sometimes bacula wants a tape that is not in my 24 slot
autochanger and that puts jobs on hold until I notice that. I need
this because my linux network is not permitted to be connected to the
internet so I can not receive emails from bacula however all clients
have dual networks so I can monitor status using nagios on my desktop.

--
John M. Drescher

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and
threat landscape has changed and how IT managers can respond. Discussions
will include endpoint security, mobile security and the latest in malware
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Bacula-users mailing list
Bacula-users < at > lists.sourceforge.net ([email]Bacula-users < at > lists.sourceforge.net[/email])
https://lists.sourceforge.net/lists/listinfo/bacula-users




--
Gilberto Nunes

(47) 9676-7530


msn: gilbertonunesferreira < at > hotmail.com ([email]gilbertonunesferreira < at > hotmail.com[/email])
msn: konnectati < at > konnectati.com.br ([email]konnectati < at > konnectati.com.br[/email])
Skype: gilberto.nunes36
Skype: konnectati


www.konnectati.com.br

Post Nagios Plungin to check mount requests 
Well....

I thing that is not so hard create a script that run a single command like
bconsole <some parameter> and check the status of directory...
Is a simple question of study how to do that... and return a value to nagios


I agree it should be pretty simple. I was asking before I had to spend
30 minutes to 1 hour of work to figure it all out since I have never
written a nagios plugin yet.

John

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and
threat landscape has changed and how IT managers can respond. Discussions
will include endpoint security, mobile security and the latest in malware
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Bacula-users mailing list
Bacula-users < at > lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bacula-users

View user's profile Send private message
Post Nagios Plungin to check mount requests 
On Thu, Aug 02, 2012 at 11:26:44AM -0400, John Drescher wrote:

I agree it should be pretty simple. I was asking before I had to spend
30 minutes to 1 hour of work to figure it all out since I have never
written a nagios plugin yet.


Just use the "check_log" script as a template and check the output of
bconsole like so (from memory):

echo "stat dir " | bconsole | grep -q "is waiting for a mount request"

or similar (basically grep's exit status). then Exit 0 from your
script for all green, 1 for warning, 2 for critical, 3 for unknown.

Cheers, Uwe

John

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and
threat landscape has changed and how IT managers can respond. Discussions
will include endpoint security, mobile security and the latest in malware
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Bacula-users mailing list
Bacula-users < at > lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bacula-users

--
NIONEX --- Ein Unternehmen der Bertelsmann AG



------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and
threat landscape has changed and how IT managers can respond. Discussions
will include endpoint security, mobile security and the latest in malware
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Bacula-users mailing list
Bacula-users < at > lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bacula-users

Post Nagios Plungin to check mount requests 
On Thu, Aug 2, 2012 at 12:34 PM, Uwe Schuerkamp
<uwe.schuerkamp < at > nionex.net> wrote:
On Thu, Aug 02, 2012 at 11:26:44AM -0400, John Drescher wrote:

I agree it should be pretty simple. I was asking before I had to spend
30 minutes to 1 hour of work to figure it all out since I have never
written a nagios plugin yet.


Just use the "check_log" script as a template and check the output of
bconsole like so (from memory):

echo "stat dir " | bconsole | grep -q "is waiting for a mount request"

or similar (basically grep's exit status). then Exit 0 from your
script for all green, 1 for warning, 2 for critical, 3 for unknown.


Looks reasonable. I will check this out soon.

Thanks,
John

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and
threat landscape has changed and how IT managers can respond. Discussions
will include endpoint security, mobile security and the latest in malware
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Bacula-users mailing list
Bacula-users < at > lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bacula-users

View user's profile Send private message
Post Nagios Plungin to check mount requests 
Hi John,

You requested the same thing two years ago!
This was my response on 3 June 2010. Works fine for me.


I don't use Nagios, I use Zabbix, but getting alerts for mount requests is
fairly simple.
I receive alerts for the following type of Bacula messages:

09-Apr 04:35 Test-sd JobId 6900: Job Example.2009-04-08_22.15.26 waiting.
Cannot find any appendable volumes.

02-Mar 08:43 Test-sd JobId 19295: Please mount Volume "000011L3" for:

How to:
In your messages resource

operatorcommand = "/etc/bacula/mountrequest.sh"
operator = nms.example.local = mount

The operator command calls my script mountrequest.sh, and the $message is
forwarded to Zabbix. Here is the guts of the script, you will need to do
whatever to send the output to nagios.

data=`cat`

error1=`echo "$data" | grep "Please mount" | awk -F" " '{ print $6,$7,$8,$9;
}'`

error2=`echo "$data" | grep appendable | awk -F" " '{ print
$9,$10,$11,$12,$13; }'`

if [[ "$error1" == "" ]]; then {

message=$error2
}
else {

message=$error1
}
fi

Hope that is of some help to you.

Regards,
Ken Barclay


-----Original Message-----
From: John Drescher [mailto:drescherjm < at > gmail.com]
Sent: Thursday, August 02, 2012 10:09 PM
To: bacula-users
Subject: [Bacula-users] Nagios Plungin to check mount requests

Does anyone have a nagios plugin that checks if bacula is waiting for a
mount request? I have seen ones that check if jobs fail or check if the
daemons are running but not one that checks if bacula is waiting on a mount.
Sometimes bacula wants a tape that is not in my 24 slot autochanger and that
puts jobs on hold until I notice that. I need this because my linux network
is not permitted to be connected to the internet so I can not receive emails
from bacula however all clients have dual networks so I can monitor status
using nagios on my desktop.

--
John M. Drescher

----------------------------------------------------------------------------
--
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and threat
landscape has changed and how IT managers can respond. Discussions will
include endpoint security, mobile security and the latest in malware
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Bacula-users mailing list
Bacula-users < at > lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bacula-users


------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and
threat landscape has changed and how IT managers can respond. Discussions
will include endpoint security, mobile security and the latest in malware
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Bacula-users mailing list
Bacula-users < at > lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bacula-users

Post Nagios Plungin to check mount requests 
You requested the same thing two years ago!
This was my response on 3 June 2010. Works fine for me.


LOL. I believe it. My primarily job role is a lead programmer for
medical imaging research. The boss does a very good job at always
keeping my busy with programming tasks leaving me little time to spend
on network administration, backups... I must have planned to look at
this but never got around to it.

Thanks,

John

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and
threat landscape has changed and how IT managers can respond. Discussions
will include endpoint security, mobile security and the latest in malware
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Bacula-users mailing list
Bacula-users < at > lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bacula-users

View user's profile Send private message
Post Nagios Plungin to check mount requests 
On Thu, Aug 2, 2012 at 12:34 PM, Uwe Schuerkamp
<uwe.schuerkamp < at > nionex.net> wrote:
On Thu, Aug 02, 2012 at 11:26:44AM -0400, John Drescher wrote:

I agree it should be pretty simple. I was asking before I had to spend
30 minutes to 1 hour of work to figure it all out since I have never
written a nagios plugin yet.


Just use the "check_log" script as a template and check the output of
bconsole like so (from memory):

echo "stat dir " | bconsole | grep -q "is waiting for a mount request"

or similar (basically grep's exit status). then Exit 0 from your
script for all green, 1 for warning, 2 for critical, 3 for unknown.

Cheers, Uwe


Thanks. I have just implemented this. I decided to base this on
check_sensors instead. Here is the preliminary code:

#! /bin/sh

PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin

PROGNAME=`basename $0`
PROGPATH=`echo $0 | sed -e 's,[\\/][^\\/][^\\/]*$,,'`
REVISION="1.4.15"

. $PROGPATH/utils.sh


print_usage() {
echo "Usage: $PROGNAME"
}

print_help() {
print_revision $PROGNAME $REVISION
echo ""
print_usage
echo ""
echo "This plugin checks to see if bacula is waiting on a mount."
echo ""
support
exit 0
}

case "$1" in
--help)
print_help
exit 0
;;
-h)
print_help
exit 0
;;
--version)
print_revision $PROGNAME $REVISION
exit 0
;;
-V)
print_revision $PROGNAME $REVISION
exit 0
;;
*)
sensordata=$(echo "stat dir " | bconsole)
status=$?
if test "$1" = "-v" -o "$1" = "--verbose"; then
echo ${sensordata}
fi
if test ${status} -eq 127; then
echo "STATUS UNKNOWN - command not found (did
you install bconsole)"
[ Wrote 65 lines ]

vs_www plugins # ./check_bacula_mount
CRITICAL - Bacula is waiting for a mount


And yes bacula is currently waiting for a tape.

vs_www plugins # bconsole
Connecting to Director fileserver:9101
1000 OK: fileserver-dir Version: 5.2.10 (28 June 2012)
Enter a period to cancel a command.
*st dir
fileserver-dir Version: 5.2.10 (28 June 2012) x86_64-pc-linux-gnu gentoo
Daemon started 05-Jan-02 02:13. Jobs: run=60, running=6 mode=0,0
Heap: heap=897,024 smbytes=673,961 max_bytes=719,759 bufs=4,247 max_bufs=4,260

Scheduled Jobs:
Level Type Pri Scheduled Name Volume
===================================================================================
Incremental Backup 10 07-Aug-12 20:30 CVSSource Other-0252
Incremental Backup 10 07-Aug-12 20:30 Info A00056
Incremental Backup 10 07-Aug-12 20:30 Publics A00056
Incremental Backup 10 07-Aug-12 20:30
WindowsSystemBackupShare-ds2-job A00056
Incremental Backup 10 07-Aug-12 20:30 user-private A00056
Full Backup 10 08-Aug-12 01:10 BackupCatalog *unknown*
====

Running Jobs:
Console connected at 07-Aug-12 11:31
JobId Level Name Status
======================================================================
29170 Full user-private.2012-08-05_20.30.00_08 is running
29172 Full Publics.2012-08-05_20.30.00_10 is waiting for a mount request
29176 Increme user-private.2012-08-06_20.30.00_15 is waiting on max
Client jobs
29177 Increme
WindowsSystemBackupShare-ds2-job.2012-08-06_20.30.00_16 is running
29178 Increme Publics.2012-08-06_20.30.00_17 is waiting on max Client jobs
29179 Increme Info.2012-08-06_20.30.00_18 is running
====

Terminated Jobs:
JobId Level Files Bytes Status Finished Name
====================================================================
29167 Incr 0 0 OK 04-Aug-12 20:30 Info
29166 Incr 0 0 OK 04-Aug-12 20:30 Publics
29164 Incr 9,381 2.330 G OK 04-Aug-12 20:36 user-private
29168 Full 1 3.820 G OK 05-Aug-12 01:22 BackupCatalog
29169 Full 1 0 OK 05-Aug-12 20:30 CVSSource
29173 Full 8,570 10.84 G OK 05-Aug-12 21:02 Info
29171 Full 544 10.73 G Error 05-Aug-12 21:04
WindowsSystemBackupShare-ds2-job
29174 Full 1 3.821 G OK 06-Aug-12 01:23 BackupCatalog
29175 Incr 0 0 OK 06-Aug-12 20:30 CVSSource
29180 Full 1 3.821 G OK 07-Aug-12 01:22 BackupCatalog

====
You have messages.

John

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and
threat landscape has changed and how IT managers can respond. Discussions
will include endpoint security, mobile security and the latest in malware
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Bacula-users mailing list
Bacula-users < at > lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bacula-users

View user's profile Send private message
Post Nagios Plungin to check mount requests 
if test ${status} -eq 127; then
echo "STATUS UNKNOWN - command not found (did
you install bconsole)"
[ Wrote 65 lines ]


Oops.. I did not get the whole script. Here goes:

vs_www plugins # cat check_bacula_mount
#! /bin/sh

PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin

PROGNAME=`basename $0`
PROGPATH=`echo $0 | sed -e 's,[\\/][^\\/][^\\/]*$,,'`
REVISION="1.4.15"

. $PROGPATH/utils.sh


print_usage() {
echo "Usage: $PROGNAME"
}

print_help() {
print_revision $PROGNAME $REVISION
echo ""
print_usage
echo ""
echo "This plugin checks to see if bacula is waiting on a mount."
echo ""
support
exit 0
}

case "$1" in
--help)
print_help
exit 0
;;
-h)
print_help
exit 0
;;
--version)
print_revision $PROGNAME $REVISION
exit 0
;;
-V)
print_revision $PROGNAME $REVISION
exit 0
;;
*)
sensordata=$(echo "stat dir " | bconsole)
status=$?
if test "$1" = "-v" -o "$1" = "--verbose"; then
echo ${sensordata}
fi
if test ${status} -eq 127; then
echo "STATUS UNKNOWN - command not found (did you install bconsole)"
exit -1
elif test ${status} -ne 0 ; then
echo "WARNING - returned state $status"
exit 1
fi
if echo ${sensordata} | egrep "is waiting for a mount request" >
/dev/null; then
echo CRITICAL - Bacula is waiting for a mount
exit 2
else
echo sensor ok
exit 0
fi
;;
esac

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and
threat landscape has changed and how IT managers can respond. Discussions
will include endpoint security, mobile security and the latest in malware
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Bacula-users mailing list
Bacula-users < at > lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bacula-users

View user's profile Send private message
Display posts from previous:
Reply to topic Page 1 of 1
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
  


Magic SEO URL for phpBB