The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

Nagios::Downtime - control downtime schedualing!

VERSION

Version 0.01

SYNOPSIS

This module lets you schedual and cancel downtime for hosts and hostgroups.

usage:

        use Nagios::Downtime;

new object:

        my $dt = Nagios::Downtime->new(
                downtime_dat_file => '/usr/nagios_2.6/var/downtime.dat',
                nagios_cmd_file => '/usr/nagios_2.6/var/rw/nagios.cmd',
                nagios_hostgroups_file => '/etc/nagios/hostgroups.cfg'
        );

or:

        my $dt = new Nagios::Downtime;

        $dt->downtime_dat_file('/usr/nagios_2.6/var/downtime.dat');
        $dt->nagios_cmd_file('/usr/nagios_2.6/var/rw/nagios.cmd');
        $dt->nagios_hostgroups_file('/etc/nagios/hostgroups.cfg');

to schedual a single host 'web1' for 5 hours downtime with commnet 'testing module' by author 'quatrix':

        $dt->start_host_downtime('web1',60 * 60 * 5,'quatrix','testing module');

same, but to schedual downtime for an entire host-group 'web-group':

        $dt->start_hostgroup_downtime('web-group',60 * 60 * 5, 'quatrix','testing module');

to cancel schedualed downtime for host 'web1':

        $dt->stop_host_downtime('web1');

to cancel schedualed downtime for entire host-group 'web-group':

        $dt->stop_hostgroup_downtime('web-group');

EXPORT

nothing is exported, you should use it OO style only.

FUNCTIONS

start_hostgroup_downtime(hostgroup_name,dt_long,author,comment)

takes 4 arguments: hostgroup_name, downtime time in seconds, author, comment

needs 'nagios_cmd_file' defined

i.e:

        $dt->start_hostgroup_downtime('web-group',600,'quatrix','for kicks');

start_host_downtime(host_name,dt_long,author,comment)

same as before, but instade hostgroup_name, it takes host_name

also, needs 'nagios_cmd_file' defined

i.e:

        $dt->start_host_downtime('web1',600,'quatrix','no one needs to know');

stop_hostgroup_downtime(hostgroup_name) this function cancels schedualed downtime for a hostgroup it takes just one argument, hostgroup_name.

needs 'nagios_cmd_file' 'nagios_hostgroups_file' and 'downtime_dat_file' defined

i.e:

        $dt->stop_hostgroup_downtime('web-group');

stop_host_downtime(host_name) again, like before, but instade of hostgroup_name, it takes hostname

needs 'nagios_cmd_file' and 'downtime_dat_file' defined.

i.e:

        $dt->stop_host_downtime('web1');

AUTHOR

quatrix, <evil.legacy AT gmail.com>

BUGS

Please report any bugs or feature requests to bug-nagios-downtime at rt.cpan.org, or through the web interface at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Nagios-Downtime. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.

SUPPORT

You can find documentation for this module with the perldoc command.

    perldoc Nagios::Downtime

You can also look for information at:

ACKNOWLEDGEMENTS

COPYRIGHT & LICENSE

Copyright 2007 quatrix, all rights reserved.

This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.