On 22 Aug 2006 at 9:58, Bill Moran wrote:
> In response to "Dan Langille" <[EMAIL PROTECTED]>:
>
> > After having the Director stop running on the 19th, and only noticing
> > it last night, I decided to start monitoring the service.
> >
> > I found bacula/examples/nagios_plugin_check_bacula.tgz but cannot
> > find how it should be compiled.
> >
> > Anyone done this?
>
> I rolled my own. It has the advantage of checking both the director and
> the SD for responsiveness. I haven't tried the one in the examples.
>
> #!/usr/bin/perl
>
> use warnings;
> use strict;
>
> # Note that there _must_ be a rule in sudoers for this to work:
> # nagios ALL=(ALL) NOPASSWD: /usr/local/sbin/bconsole
> open BC, "echo \"status storage=${ARGV[1]}\" | sudo /usr/local/sbin/bconsole
> |"
> or die "bconsole: $!";
I tried creating for for FD checking, but found I had to take a
different approach.
open BC, "echo \"status client=${ARGV[1]}\" |
/usr/local/sbin/bconsole -c /usr/local/etc/bconsole.conf |"
or die "bconsole: $!";
That line is pretty much the same
>
> my $result = "BACULA: critical";
> my $return = 2;
> while (my $line = <BC>)
> {
> chomp $line;
> if ($line eq "Connecting to Storage daemon ${ARGV[1]} at
> ${ARGV[0]}:9103") {
It was this line I need to change. I found the above always gave OK,
even if the FD was not running. The following line worked properly:
if ($line eq "Terminated Jobs:") {
...FYI...
> $result = "BACULA: ok";
> $return = 0;
> last;
> }
> }
>
> print "$result\n";
> exit $return;
>
>
> --
> Bill Moran
> Collaborative Fusion Inc.
>
--
Dan Langille : Software Developer looking for work
my resume: http://www.freebsddiary.org/dan_langille.php
-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Bacula-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bacula-users