centreon-plugins/os/linux/local/plugin.pm

81 lines
3.8 KiB
Perl
Raw Normal View History

################################################################################
2013-12-13 16:14:12 +01:00
# Copyright 2005-2013 MERETHIS
# Centreon is developped by : Julien Mathis and Romain Le Merlus under
# GPL Licence 2.0.
#
# 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 of the License.
#
# 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.
#
# You should have received a copy of the GNU General Public License along with
# this program; if not, see <http://www.gnu.org/licenses>.
#
# Linking this program statically or dynamically with other modules is making a
# combined work based on this program. Thus, the terms and conditions of the GNU
# General Public License cover the whole combination.
#
# As a special exception, the copyright holders of this program give MERETHIS
# permission to link this program with independent modules to produce an executable,
# regardless of the license terms of these independent modules, and to copy and
# distribute the resulting executable under terms of MERETHIS choice, provided that
# MERETHIS also meet, for each linked independent module, the terms and conditions
# of the license of that module. An independent module is a module which is not
# derived from this program. If you modify this program, you may extend this
# exception to your version of the program, but you are not obliged to do so. If you
# do not wish to do so, delete this exception statement from your version.
#
# For more information : contact@centreon.com
2013-12-13 16:14:12 +01:00
# Authors : Quentin Garnier <qgarnier@merethis.com>
#
####################################################################################
2014-01-27 17:12:58 +01:00
package os::linux::local::plugin;
2013-12-13 16:14:12 +01:00
use strict;
use warnings;
2014-01-27 17:12:58 +01:00
use base qw(centreon::plugins::script_simple);
2013-12-13 16:14:12 +01:00
sub new {
my ($class, %options) = @_;
my $self = $class->SUPER::new(package => __PACKAGE__, %options);
bless $self, $class;
# $options->{options} = options object
$self->{version} = '0.1';
%{$self->{modes}} = (
2014-03-12 11:50:01 +01:00
'cpu' => 'os::linux::local::mode::cpu',
'cmd-return' => 'os::linux::local::mode::cmdreturn',
'diskio' => 'os::linux::local::mode::diskio',
2014-03-12 11:50:01 +01:00
'files-size' => 'os::linux::local::mode::filessize',
'files-date' => 'os::linux::local::mode::filesdate',
'inodes' => 'os::linux::local::mode::inodes',
2014-03-12 11:50:01 +01:00
'load' => 'os::linux::local::mode::loadaverage',
2014-03-12 17:31:16 +01:00
'list-interfaces' => 'os::linux::local::mode::listinterfaces',
'list-partitions' => 'os::linux::local::mode::listpartitions',
'list-storages' => 'os::linux::local::mode::liststorages',
2014-03-12 11:50:01 +01:00
'memory' => 'os::linux::local::mode::memory',
'packet-errors' => 'os::linux::local::mode::packeterrors',
2014-03-12 14:39:42 +01:00
'process' => 'os::linux::local::mode::process',
2014-03-12 11:50:01 +01:00
'storage' => 'os::linux::local::mode::storage',
'swap' => 'os::linux::local::mode::swap',
2014-03-12 17:31:16 +01:00
'traffic' => 'os::linux::local::mode::traffic',
2014-03-20 10:03:21 +01:00
'uptime' => 'os::linux::local::mode::uptime',
2013-12-13 16:14:12 +01:00
);
return $self;
}
2013-12-13 16:14:12 +01:00
1;
2013-12-13 16:14:12 +01:00
__END__
2013-12-13 16:14:12 +01:00
=head1 PLUGIN DESCRIPTION
2014-01-27 17:12:58 +01:00
Check Linux through local commands (the plugin can use SSH).
2013-12-13 16:14:12 +01:00
=cut