Giter VIP home page Giter VIP logo

nagios-plugins's People

Contributors

coudot avatar davidcoutadeur avatar dilyanpalauzov avatar xavierba avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

nagios-plugins's Issues

Fix check of deltacsn in check_ldap_syncrepl_status.pl

Starting at line 580:

    if ( $deltacsn < $warning ) {
        print
"OK - directories are not in sync - $deltacsn seconds late (W:$warning - C:$critical)$perfparse";
        exit $ERRORS{'OK'};
    }
    elsif ( $deltacsn > $warning and $deltacsn < $critical ) {
        print
"WARNING - directories are not in sync - $deltacsn seconds late (W:$warning - C:$critical)$perfparse";
        exit $ERRORS{'WARNING'};
    }
    else {
        print
"CRITICAL - directories are not in sync - $deltacsn seconds late (W:$warning - C:$critical)$perfparse";
        exit $ERRORS{'CRITICAL'};
    }

...if $warning is equal to $deltacsn, then the warning is incorrectly reported as CRITICAL. Line 585:

 elsif ( $deltacsn > $warning and $deltacsn < $critical ) {

...should be:

 elsif ( $deltacsn >= $warning and $deltacsn < $critical ) {

Very useful overall. Thank you.

Bob

Delta CSN is not correct in Syncrepl plugin

Found by Geert Hendrickx:

I noticed an issue with the way you calculate the time difference:

my $deltacsn = abs( $mastercsn_elts[0] - $slavecsn_elts[0] );

and then print:

"WARNING - directories are not in sync with $master_host - $deltacsn seconds late (W:$warning - C:$critical)$perfparse";

However the delta between two ContextCSN timestamps in decimal notation cannot simply be interpreted as seconds...

For example, take 2016/09/21 13:02:23 and 2016/09/21 12:07:24.
You calculate: 20160921130223 - 20160921120724 and print: "9499 seconds late", while it is fact only 54:59 or 3299 seconds.
You need to substract seconds/minutes/hours(days?) individually and then glue them back together.

It's not just a display problem. Eg. an alert threshold of 300 seconds (5 minutes) is reached already after 3:00 (3 minutes).

Tag please

Hello

Your latest commit for check_ldap_syncrepl_status isn't tagged, I fixed the path issue on my side before realizing.

Best regards,

The module does not UNBIND when closing connections

An example connection string, notice the (connection lost) at the end. If the module performed an UNBIND operation, we would not receive this error.

Nov 3 12:07:37 y slapd[11164]: conn=1037 fd=25 ACCEPT from IP=x.x.x.x:35998 (IP=z.z.z.z:636)
Nov 3 12:07:37 y slapd[11164]: conn=1037 fd=25 TLS established tls_ssf=256 ssf=256
Nov 3 12:07:37 y slapd[11164]: conn=1037 op=0 BIND dn="" method=128
Nov 3 12:07:37 y slapd[11164]: conn=1037 op=0 RESULT tag=97 err=0 text=
Nov 3 12:07:37 y slapd[11164]: conn=1037 op=1 SRCH base="" scope=0 deref=2 filter="(objectClass=)"
Nov 3 12:07:37 y slapd[11164]: conn=1037 op=1 SRCH attr=namingcontexts
Nov 3 12:07:37 y slapd[11164]: conn=1037 op=1 SEARCH RESULT tag=101 err=0 nentries=1 text=
Nov 3 12:07:37 y slapd[11164]: conn=1037 op=2 SRCH base="dc=x,dc=gov" scope=0 deref=2 filter="(objectClass=
)"
Nov 3 12:07:37 y slapd[11164]: conn=1037 op=2 SRCH attr=contextCSN
Nov 3 12:07:37 y slapd[11164]: conn=1037 op=2 SEARCH RESULT tag=101 err=0 nentries=1 text=

++++. UNBIND should happen here ++++++

Nov 3 12:07:37 y slapd[11164]: conn=1037 fd=25 closed (connection lost)

Use more path to find Nagios utils.pm module

In some plugins (like check_ldap_monitor) we only search utils.pm in /usr/local/nagios/libexec

We should always use:

use lib qw(/usr/local/nagios/libexec /usr/lib/nagios/plugins /usr/lib64/nagios/plugins);

when check_lmdb_usage cannot find mdb_stat we get a Illegal division by zero

Hello,

i use check_lmdb_usage and forgot to install mdb_stat, i got this error

check_lmdb_usage.pl -S /usr/bin/mdb_stat -H /var/lib/ldap/ -w 80 -c 90
Can't exec "/usr/bin/mdb_stat": No such file or directory at ./check_lmdb_usage.pl line 195.
Illegal division by zero at ./check_lmdb_usage.pl line 217.

Cheers

lesser and greater mode are inverted

In check_ldap_query and check_ldap_monitor.pl, we can choose greater/lesser mode for the warning and critical threshold, but it seems the behavior is inverted:

clement@ader-worteks:~/dev/nagios-plugins$ perl check_ldap_query.pl -H localhost -b dc=example,dc=com -m lesser -w 10 -c 50
CRITICAL - 500 entries returned  
clement@ader-worteks:~/dev/nagios-plugins$ perl check_ldap_monitor.pl -H localhost -T currentconnections -m lesser -w 5 -c 10
OK - 1 current connections returned 
clement@ader-worteks:~/dev/nagios-plugins$ perl check_ldap_monitor.pl -H localhost -T currentconnections -m greater -w 50 -c 10
CRITICAL - 1 current connections returned 

check_ldap_monitor.pl give errors in perl 5.20 on debian strech

Hello,

when running the check_ldap_monitor on stretch with the following parameters i got perl errors.

check_ldap_monitor.pl -H ldap://localhost -D "cn=monitoring,cn=monitor" -b cn=monitor -P tester -T currentconnections -m greater -w 10 -c 15 -f -vvv
VERBOSE 3 ===> Enter &get_ldapconn
VERBOSE 2 ===> Connected to ldap://localhost
VERBOSE 2 ===> Bind with cn=monitoring,cn=monitor
VERBOSE 3 ===> Leave &get_ldapconn
VERBOSE 3 ===> Enter &get_value
Use of uninitialized value $result in concatenation (.) or string at ./check_ldap_monitor.pl line 395, <DATA> line 751.
VERBOSE 2 ===> Found value 
VERBOSE 3 ===> Leave &get_value
Use of uninitialized value $value in concatenation (.) or string at ./check_ldap_monitor.pl line 592, <DATA> line 751.
Use of uninitialized value $value in numeric lt (<) at ./check_ldap_monitor.pl line 597, <DATA> line 751.
Use of uninitialized value $value in concatenation (.) or string at ./check_ldap_monitor.pl line 598, <DATA> line 751.
OK -  current connections returned |'currentconnections'=;10;15

Cheers

Clarify why the relative sum of used and free pages is not 100%

check_lmdb_usage.pl and check_ldap_monitor.pl read

  Max pages: 768
  Number of pages used: 148
  Free pages: 31

And calculate:

  • per cent of free pages = 31 * 100 / 768 = 4.03%
  • per cent of used pages = 148 * 100 / 768 = 19.27%

Contrary to intuition, the sum of the per cent is not 100.

I kindly ask to extend the documentation and include explanation, why the sum is not 100%.

With this explanation it will be easier to understand what OpenLDAP monitoring does and what one wants really to monitor.

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.