[Nagios-devel] Nagios::Cmd perl module
Posted: Fri Sep 19, 2003 1:26 pm
--=-776+j6Gwslu9qwoxn0qc
Content-Type: text/plain
Content-Transfer-Encoding: 7bit
For submission under the GPL, a quick module I threw together for
submitting commands to the Nagios command pipe.
Attached.
-Al Tobey
** ** ** PRIVILEGED AND CONFIDENTIAL ** ** **
This email transmission contains privileged and confidential information
intended only for the use of the individual or entity named above. Any
unauthorized review, use, disclosure or distribution is prohibited and
may be a violation of law. If you are not the intended recipient or a
person responsible for delivering this message to an intended recipient,
please delete the email and immediately notify the sender via the email
return address or mailto:[email protected]. Thank you.
--=-776+j6Gwslu9qwoxn0qc
Content-Disposition: attachment; filename=Cmd.pm
Content-Type: text/plain; name=Cmd.pm; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
###########################################################################
# #
# Nagios::Cmd #
# Written by Albert Tobey #
# Copyright 2003, Albert P Tobey #
# #
# This program is free software; you can redistribute it and/or modify it #
# under the terms of the GNU General Public License as published by the #
# Free Software Foundation; either version 2, or (at your option) any #
# later version. #
# #
# This program is distributed in the hope that it will be useful, but #
# WITHOUT ANY WARRANTY; without even the implied warranty of #
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU #
# General Public License for more details. #
# #
###########################################################################
package Nagios::Cmd;
use vars qw( $debug %commands );
use Fcntl ':flock';
require '5.6.0';
$debug = undef;
%commands = (
ADD_HOST_COMMENT => [qw(host persistent author comment)],
ADD_SVC_COMMENT => [qw(host service persistent author comment)],
DEL_HOST_COMMENT => [qw(comment_id)],
DEL_ALL_HOST_COMMENTS => [qw(host)],
DEL_SVC_COMMENT => [qw(comment_id)],
DEL_ALL_SVC_COMMENTS => [qw(host service)],
DELAY_HOST_NOTIFICATION => [qw(host next_notification_time)],
DELAY_SVC_NOTIFICATION => [qw(host service next_check_time)],
SCHEDULE_HOST_SVC_CHECKS => [qw(host next_check_time)],
ENABLE_SVC_CHECKS => [qw(host service)],
DISABLE_SVC_CHECKS => [qw(host service)],
ENABLE_SVC_NOTIFICATIONS => [qw(host service)],
DISABLE_SVC_NOTIFICATIONS => [qw(host service)],
ENABLE_HOST_SVC_NOTIFICATIONS => [qw(host)],
DISABLE_HOST_SVC_NOTIFICATIONS => [qw(host)],
ENABLE_HOST_SVC_CHECKS => [qw(host)],
DISABLE_HOST_SVC_CHECKS => [qw(host)],
ENABLE_HOST_NOTIFICATIONS => [qw(host)],
DISABLE_HOST_NOTIFICATIONS => [qw(host)],
ENABLE_ALL_NOTIFICATIONS_BEYOND_HOST => [qw(host)],
DISABLE_ALL_NOTIFICATIONS_BEYOND_HOST => [qw(host)],
ENABLE_NOTIFICATIONS => [qw(time)],
DISABLE_NOTIFICATIONS => [qw(time)],
SHUTDOWN_PROGRAM => [qw(time)],
RESTART_PROGRAM => [qw(time)],
PROCESS_SERVICE_CHECK_RESULT => [qw(host service return_code plugin_output)],
SAVE_STATE_INFORMATION => [qw(time)],
READ_STATE_INFORMATION => [qw(time)],
START_EXECUTING_SVC_CHECKS => undef,
STOP_EXECUTING_SVC_CHECKS => undef,
START_ACCEPTING_PASSIVE_SVC_CHECKS => undef,
STOP_ACCEPTING_PASSIVE_SVC_CHECKS => undef,
ENABLE_PASSIVE_SVC_CHECKS => [qw(host service)],
DISABLE_PASSIVE_SV_CHECKS => [qw(host service)],
ACKNOWLEDGE_SVC_PROBLEM => [qw(host service persistent comment)],
ACKNOWLEDGE_HOST_PROBLEM => [qw(host persistent comment)]
);
sub new {
my( $type, $cmdfile ) = @_;
die "$cmdfile does not exist!"
...[email truncated]...
This post was automatically imported from historical nagios-devel mailing list archives
Original poster: [email protected]
Content-Type: text/plain
Content-Transfer-Encoding: 7bit
For submission under the GPL, a quick module I threw together for
submitting commands to the Nagios command pipe.
Attached.
-Al Tobey
** ** ** PRIVILEGED AND CONFIDENTIAL ** ** **
This email transmission contains privileged and confidential information
intended only for the use of the individual or entity named above. Any
unauthorized review, use, disclosure or distribution is prohibited and
may be a violation of law. If you are not the intended recipient or a
person responsible for delivering this message to an intended recipient,
please delete the email and immediately notify the sender via the email
return address or mailto:[email protected]. Thank you.
--=-776+j6Gwslu9qwoxn0qc
Content-Disposition: attachment; filename=Cmd.pm
Content-Type: text/plain; name=Cmd.pm; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
###########################################################################
# #
# Nagios::Cmd #
# Written by Albert Tobey #
# Copyright 2003, Albert P Tobey #
# #
# This program is free software; you can redistribute it and/or modify it #
# under the terms of the GNU General Public License as published by the #
# Free Software Foundation; either version 2, or (at your option) any #
# later version. #
# #
# This program is distributed in the hope that it will be useful, but #
# WITHOUT ANY WARRANTY; without even the implied warranty of #
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU #
# General Public License for more details. #
# #
###########################################################################
package Nagios::Cmd;
use vars qw( $debug %commands );
use Fcntl ':flock';
require '5.6.0';
$debug = undef;
%commands = (
ADD_HOST_COMMENT => [qw(host persistent author comment)],
ADD_SVC_COMMENT => [qw(host service persistent author comment)],
DEL_HOST_COMMENT => [qw(comment_id)],
DEL_ALL_HOST_COMMENTS => [qw(host)],
DEL_SVC_COMMENT => [qw(comment_id)],
DEL_ALL_SVC_COMMENTS => [qw(host service)],
DELAY_HOST_NOTIFICATION => [qw(host next_notification_time)],
DELAY_SVC_NOTIFICATION => [qw(host service next_check_time)],
SCHEDULE_HOST_SVC_CHECKS => [qw(host next_check_time)],
ENABLE_SVC_CHECKS => [qw(host service)],
DISABLE_SVC_CHECKS => [qw(host service)],
ENABLE_SVC_NOTIFICATIONS => [qw(host service)],
DISABLE_SVC_NOTIFICATIONS => [qw(host service)],
ENABLE_HOST_SVC_NOTIFICATIONS => [qw(host)],
DISABLE_HOST_SVC_NOTIFICATIONS => [qw(host)],
ENABLE_HOST_SVC_CHECKS => [qw(host)],
DISABLE_HOST_SVC_CHECKS => [qw(host)],
ENABLE_HOST_NOTIFICATIONS => [qw(host)],
DISABLE_HOST_NOTIFICATIONS => [qw(host)],
ENABLE_ALL_NOTIFICATIONS_BEYOND_HOST => [qw(host)],
DISABLE_ALL_NOTIFICATIONS_BEYOND_HOST => [qw(host)],
ENABLE_NOTIFICATIONS => [qw(time)],
DISABLE_NOTIFICATIONS => [qw(time)],
SHUTDOWN_PROGRAM => [qw(time)],
RESTART_PROGRAM => [qw(time)],
PROCESS_SERVICE_CHECK_RESULT => [qw(host service return_code plugin_output)],
SAVE_STATE_INFORMATION => [qw(time)],
READ_STATE_INFORMATION => [qw(time)],
START_EXECUTING_SVC_CHECKS => undef,
STOP_EXECUTING_SVC_CHECKS => undef,
START_ACCEPTING_PASSIVE_SVC_CHECKS => undef,
STOP_ACCEPTING_PASSIVE_SVC_CHECKS => undef,
ENABLE_PASSIVE_SVC_CHECKS => [qw(host service)],
DISABLE_PASSIVE_SV_CHECKS => [qw(host service)],
ACKNOWLEDGE_SVC_PROBLEM => [qw(host service persistent comment)],
ACKNOWLEDGE_HOST_PROBLEM => [qw(host persistent comment)]
);
sub new {
my( $type, $cmdfile ) = @_;
die "$cmdfile does not exist!"
...[email truncated]...
This post was automatically imported from historical nagios-devel mailing list archives
Original poster: [email protected]