Git Product home page Git Product logo

monitoring-plugin-perl's Introduction

Monitoring Plugins

  • For instructions on installing these plugins for use with your monitoring system, see below. In addition, generic instructions for the GNU toolchain can be found in the INSTALL file.

  • For major changes between releases, read the NEWS file.

  • For information on detailed changes that have been made or plugins that have been added, read the ChangeLog file.

  • Some plugins require that you have additional programs or libraries installed on your system before they can be used. Plugins that are dependent on other programs/libraries that are missing are usually not compiled. Read the REQUIREMENTS file for more information.

  • Individual plugins are self-documenting. All plugins that comply with the basic guidelines for development will provide detailed help when invoked with the -h or --help options.

You can check the latest plugins at:

Send an email to [email protected] for assistance. Please include the OS type and version that you are using. Also, run the plugin with the -vvv option and provide the resulting version information. Of course, there may be additional diagnostic information required as well. Use good judgment.

Send an email to [email protected] for developer discussions.

For patch submissions and bug reports, please use the appropriate resources at:

Installation Instructions

  1. If you are using the Git tree, you will need m4, gettext, automake, and autoconf. To start out, run:

    ./tools/setup
    

    For more detail, see the developer guidelines at https://www.monitoring-plugins.org/doc/guidelines.html.

  2. Run the configure script to initialize variables and create a Makefile, etc.

    ./configure --prefix=BASEDIRECTORY --with-cgiurl=SOMEURL
    

    Replace BASEDIRECTORY with the path of the directory under which your monitoring system is installed (default is /usr/local), and replace SOMEURL with the path used to access the monitoring system CGIs with a web browser (default is /nagios/cgi-bin).

  3. Compile the plugins with the following command:

    make
    
  4. Install the compiled plugins and plugin scripts with the following command:

    make install
    

    The installation procedure will attempt to place the plugins in a libexec/ subdirectory in the base directory you specified with the --prefix argument to the configure script.

  5. There are some plugins that require setuid. If you run make install as a non-root user, they will not be installed. To install, switch to root and run:

    make install-root
    

That's it! If you have any problems or questions, feel free to send an email to [email protected].

License Notice

You can redistribute and/or modify this software under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version; with the additional exemption that compiling, linking, and/or using OpenSSL is allowed.

This software 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 COPYING file for the complete text of the GNU General Public License, version 3.

monitoring-plugin-perl's People

Contributors

daku3649 avatar dermoth avatar evgeni avatar g0hl1n avatar infraweavers avatar manwar avatar mstock avatar pdugas avatar sni avatar tejr avatar weiss avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

monitoring-plugin-perl's Issues

Add LONGOUTPUT parameter to plugin_exit

I'd like to be able to use something like the code below to emit additional lines of LONGOUTPUT from a plugin.

$plugin->plugin_exit(OK, "All good", "additional\ndetails\nhere")

The output from this would be something like

OK - All good
additional
details
here|perfdata...

Performance.pm->perfoutput does not handle empty value correctly

I use check_squid.pl developed by Cyril Feraudet in Version 1.1

That uses package Nagios::Plugin which is version 0.36

The script gives out invalid performance data because value is sometimes empty and that is not handleded correctly and leads to invalid performance data output.

check_squid.pl creates a new Nagios::Plugin object and then adds the performance value with method add_perfdata

pnp4nagios claims invalid performance data, which is true, because after the = sign comes directly the UOM:

2015-11-27 11:45:06 [2996] [1] Found Performance Data for MYHOST / Squid_Cache ('Requests Hit Ratio 5min'=0.0%;; 'Requests Hit Ratio 60min'=0.2%;; 'Byte Hit Ratio 5min'=%;; 'Byte Hit Ratio 60min'=%;;)
2015-11-27 11:45:06 [2996] [1] Invalid Perfdata detected

I did a workaround for this in Performance.pm perfoutput method like so:

sub perfoutput {
    my $self = shift;
    # Add quotes if label contains a space character
    my $label = $self->label;
    if ($label =~ / /) {
        $label = "'$label'";
    }

    my $value = $self->value;

    if ($value eq '') {
        $value = 'U';
    }

    my $out = sprintf "%s=%s%s;%s;%s;%s;%s",
        $label,
        $value,
        $self->_nvl($self->uom),
        $self->_nvl($self->warning),
        $self->_nvl($self->critical),
        $self->_nvl($self->min),
        $self->_nvl($self->max);
    # Previous implementation omitted trailing ;; - do we need this?
    $out =~ s/;;$//;

    return $out;
}

So if value is empty, it is changed to value "U" which means that the value could not have been determined, according to Nagios Plugin development guidelines, section Performance data.

Can't locate Monitoring/Plugin.pm

Problem: when rinning 'bin/check_raid.pl -S' I get this error

Can't locate Monitoring/Plugin.pm in @INC (you may need to install the Monitoring::Plugin module) (@INC contains: /etc/perl /usr/local/lib/x86_64-linux-gnu/perl/5.20.2 /usr/local/share/perl/5.20.2 /usr/lib/x86_64-linux-gnu/perl5/5.20 /usr/share/perl5 /usr/lib/x86_64-linux-gnu/perl/5.20 /usr/share/perl/5.20 /usr/local/lib/site_perl .) at bin/check_raid.pl line 2.
BEGIN failed--compilation aborted at bin/check_raid.pl line 2.

Environment: debian 8.2 x86_64 and debian 7.8 x86_64.

Steps:
downloaded the plugin in /tmp and extracted the tar.gz.
cd nagios-plugin-check_raid-master

Following the readme I run bin/check_raid.pl -S but I get the errore above.
I also tried to install libnagios-object-perl and libnagios-plugin-perl as suggested in this post
http://www.monitoring-portal.org/wbb/index.php?page=Thread&threadID=25251

In this other post they point out the issue about a path:
https://viewsby.wordpress.com/2014/02/20/perlnagios-cant-locate-utils-pm-in-inc/

I hope I'm not missing something trivial.

[doc] missing documentation

http://search.cpan.org/~nierlein/Monitoring-Plugin-0.39/lib/Monitoring/Plugin.pm#CONSTRUCTOR

there's no documentation for version, blurb, license, extra, plugin, timeout parameters

as for example i was looking where to put information about homepage and where to report bugs and copyright years and author.


for homepage and bugs url, i just appended to blurb:
glensc/nagios-plugin-check_raid@cd17820

for license and copyright did not find good solution: i do not want to replace license key, i like that default GPLv2 is printed.

here's example how my plugin worked before starting to use perl-Monitoring-Plugin, and after

➔ ./check_raid-3.2.5.pl --help | head -n10
check_raid, v3.2.5
Copyright (c) 2004-2006 Steve Shipway,
Copyright (c) 2009-2015, Elan Ruusamäe <[email protected]>

This plugin reports the current server's RAID status
https://github.com/glensc/nagios-plugin-check_raid

Usage: check_raid [-h] [-V] [-S] [list of devices to ignore]
➔ ./check_raid-4.0.1.pl --help | head -n10
check_raid 4.0.1

This nagios plugin is free software, and comes with ABSOLUTELY NO WARRANTY.
It may be used, redistributed and/or modified under the terms of the GNU
General Public Licence (see http://www.fsf.org/licensing/licenses/gpl.txt).

This plugin checks all RAID volumes (hardware and software) that can be identified.

Usage: check_raid [-h] [-V] [-S] [list of devices to ignore]

Cosmetic: First "perl Makefile.PL" complains about META.yml

The first time you run "perl Makefile.PL" after cloning, the script complains about META.yml... and then proceeds to write it out. This is cosmetic in nature, though may "panic" the unwary.

$ perl Makefile.PL 
include /home/my_home_dir/github/monitoring-plugin-perl/inc/Module/Install.pm
include inc/Module/Install/Metadata.pm
include inc/Module/Install/Base.pm
include inc/Module/Install/Makefile.pm
include inc/Module/Install/WriteAll.pm
include inc/Module/Install/Win32.pm
include inc/Module/Install/Can.pm
include inc/Module/Install/Fetch.pm
Checking if your kit is complete...
Warning: the following files are missing in your kit:
	META.yml
Please inform the author.
Writing Makefile for Monitoring::Plugin
Writing MYMETA.yml and MYMETA.json
Writing META.yml

Possible modifications to message methods

Hi,
since message methods are marked as experimental in Monitoring::Plugin documentation, I made my own methods for a plugin I wrote some time ago (not wanting to depend on something which may change without notice). Since I need them now for another plugin, I'm facing the problem of sharing that code between the two scripts, trying to keep around as less extra modules as possible.

Ideally, the best solution would be to integrate those methods into Monitoring::Plugin distribution (if you like the way they work). Is this a possibility we can discuss?

You can find the code I made into: https://github.com/kromg/nagios-plugins/blob/master/check_end2end.pl, it's the Monitoring::Plugin::Ens2End package. The package can also keep track of the current status of the check, it's made to handle those checks where the overall exit status is built from many sub-checks.

Thanks,
Giacomo

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.