New upstream version 2.4.0
This commit is contained in:
parent
d5a5faa95b
commit
600e193ca4
102 changed files with 16219 additions and 31778 deletions
|
@ -1,7 +1,7 @@
|
|||
# Makefile.in generated by automake 1.16.3 from Makefile.am.
|
||||
# Makefile.in generated by automake 1.16.5 from Makefile.am.
|
||||
# @configure_input@
|
||||
|
||||
# Copyright (C) 1994-2020 Free Software Foundation, Inc.
|
||||
# Copyright (C) 1994-2021 Free Software Foundation, Inc.
|
||||
|
||||
# This Makefile.in is free software; the Free Software Foundation
|
||||
# gives unlimited permission to copy and/or distribute it,
|
||||
|
@ -163,8 +163,7 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/libcurl.m4 \
|
|||
$(top_srcdir)/gl/m4/nocrash.m4 $(top_srcdir)/gl/m4/off_t.m4 \
|
||||
$(top_srcdir)/gl/m4/open-cloexec.m4 \
|
||||
$(top_srcdir)/gl/m4/open-slash.m4 $(top_srcdir)/gl/m4/open.m4 \
|
||||
$(top_srcdir)/gl/m4/pathmax.m4 $(top_srcdir)/gl/m4/pid_t.m4 \
|
||||
$(top_srcdir)/gl/m4/printf.m4 \
|
||||
$(top_srcdir)/gl/m4/pathmax.m4 $(top_srcdir)/gl/m4/printf.m4 \
|
||||
$(top_srcdir)/gl/m4/pthread_rwlock_rdlock.m4 \
|
||||
$(top_srcdir)/gl/m4/realloc.m4 \
|
||||
$(top_srcdir)/gl/m4/reallocarray.m4 \
|
||||
|
@ -177,7 +176,6 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/libcurl.m4 \
|
|||
$(top_srcdir)/gl/m4/sockets.m4 $(top_srcdir)/gl/m4/socklen.m4 \
|
||||
$(top_srcdir)/gl/m4/sockpfaf.m4 $(top_srcdir)/gl/m4/ssize_t.m4 \
|
||||
$(top_srcdir)/gl/m4/stat-time.m4 $(top_srcdir)/gl/m4/stat.m4 \
|
||||
$(top_srcdir)/gl/m4/std-gnu11.m4 \
|
||||
$(top_srcdir)/gl/m4/stdalign.m4 \
|
||||
$(top_srcdir)/gl/m4/stddef_h.m4 $(top_srcdir)/gl/m4/stdint.m4 \
|
||||
$(top_srcdir)/gl/m4/stdint_h.m4 $(top_srcdir)/gl/m4/stdio_h.m4 \
|
||||
|
@ -195,7 +193,6 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/libcurl.m4 \
|
|||
$(top_srcdir)/gl/m4/time_r.m4 $(top_srcdir)/gl/m4/timegm.m4 \
|
||||
$(top_srcdir)/gl/m4/ungetc.m4 $(top_srcdir)/gl/m4/unistd_h.m4 \
|
||||
$(top_srcdir)/gl/m4/unlocked-io.m4 \
|
||||
$(top_srcdir)/gl/m4/vararrays.m4 \
|
||||
$(top_srcdir)/gl/m4/vasnprintf.m4 \
|
||||
$(top_srcdir)/gl/m4/vasprintf.m4 \
|
||||
$(top_srcdir)/gl/m4/visibility.m4 \
|
||||
|
@ -469,6 +466,8 @@ CFLAGS = @CFLAGS@
|
|||
CFLAG_VISIBILITY = @CFLAG_VISIBILITY@
|
||||
CPP = @CPP@
|
||||
CPPFLAGS = @CPPFLAGS@
|
||||
CSCOPE = @CSCOPE@
|
||||
CTAGS = @CTAGS@
|
||||
CYGPATH_W = @CYGPATH_W@
|
||||
DBILIBS = @DBILIBS@
|
||||
DEFS = @DEFS@
|
||||
|
@ -488,6 +487,7 @@ ENOLINK_VALUE = @ENOLINK_VALUE@
|
|||
EOVERFLOW_HIDDEN = @EOVERFLOW_HIDDEN@
|
||||
EOVERFLOW_VALUE = @EOVERFLOW_VALUE@
|
||||
ERRNO_H = @ERRNO_H@
|
||||
ETAGS = @ETAGS@
|
||||
EXEEXT = @EXEEXT@
|
||||
EXTRAS = @EXTRAS@
|
||||
EXTRAS_ROOT = @EXTRAS_ROOT@
|
||||
|
@ -1859,6 +1859,8 @@ install_sh = @install_sh@
|
|||
libdir = @libdir@
|
||||
libexecdir = @libexecdir@
|
||||
localedir = @localedir@
|
||||
localedir_c = @localedir_c@
|
||||
localedir_c_make = @localedir_c_make@
|
||||
localstatedir = @localstatedir@
|
||||
mandir = @mandir@
|
||||
mkdir_p = @mkdir_p@
|
||||
|
@ -2141,7 +2143,6 @@ recheck: all
|
|||
@am__EXEEXT_TRUE@ --log-file $$b.log --trs-file $$b.trs \
|
||||
@am__EXEEXT_TRUE@ $(am__common_driver_flags) $(AM_TEST_LOG_DRIVER_FLAGS) $(TEST_LOG_DRIVER_FLAGS) -- $(TEST_LOG_COMPILE) \
|
||||
@am__EXEEXT_TRUE@ "$$tst" $(AM_TESTS_FD_REDIRECT)
|
||||
|
||||
distdir: $(BUILT_SOURCES)
|
||||
$(MAKE) $(AM_MAKEFLAGS) distdir-am
|
||||
|
||||
|
|
|
@ -40,15 +40,16 @@
|
|||
|
||||
# ----------------------------------------------------------------[ Require ]--
|
||||
|
||||
require 5.004;
|
||||
require 5.14.0;
|
||||
|
||||
# -------------------------------------------------------------------[ Uses ]--
|
||||
|
||||
use Socket;
|
||||
use strict;
|
||||
use IO::Socket::IP;
|
||||
use Getopt::Long;
|
||||
use vars qw($opt_V $opt_h $opt_t $opt_p $opt_H $opt_w $opt_c $verbose);
|
||||
use vars qw($opt_V $opt_h $opt_t $opt_p $opt_H $opt_w $opt_c $opt_4 $opt_6 $verbose);
|
||||
use vars qw($PROGNAME);
|
||||
use vars qw($ClientSocket);
|
||||
use FindBin;
|
||||
use lib "$FindBin::Bin";
|
||||
use utils qw($TIMEOUT %ERRORS &print_revision &support &usage);
|
||||
|
@ -58,7 +59,6 @@ use utils qw($TIMEOUT %ERRORS &print_revision &support &usage);
|
|||
sub print_help ();
|
||||
sub print_usage ();
|
||||
sub connection ($$$$);
|
||||
sub bindRemote ($$);
|
||||
|
||||
# -------------------------------------------------------------[ Environment ]--
|
||||
|
||||
|
@ -104,7 +104,7 @@ sub connection ($$$$)
|
|||
$answer = "Server $in_remotehost has less than 0 users! Something is Really WRONG!\n";
|
||||
}
|
||||
|
||||
print ClientSocket "quit\n";
|
||||
print $ClientSocket "quit\n";
|
||||
print $answer;
|
||||
exit $ERRORS{$state};
|
||||
}
|
||||
|
@ -112,7 +112,7 @@ sub connection ($$$$)
|
|||
# ------------------------------------------------------------[ print_usage ]--
|
||||
|
||||
sub print_usage () {
|
||||
print "Usage: $PROGNAME -H <host> [-w <warn>] [-c <crit>] [-p <port>]\n";
|
||||
print "Usage: $PROGNAME -H <host> [-w <warn>] [-c <crit>] [-p <port>] [ -4|-6 ]\n";
|
||||
}
|
||||
|
||||
# -------------------------------------------------------------[ print_help ]--
|
||||
|
@ -135,33 +135,15 @@ Perl Check IRCD plugin for monitoring
|
|||
Number of connected users which generates a critical state (Default: 100)
|
||||
-p, --port=INTEGER
|
||||
Port that the ircd daemon is running on <host> (Default: 6667)
|
||||
-4, --use-ipv4
|
||||
Use IPv4 connection
|
||||
-6, --use-ipv6
|
||||
Use IPv6 connection
|
||||
-v, --verbose
|
||||
Print extra debugging information
|
||||
";
|
||||
}
|
||||
|
||||
# -------------------------------------------------------------[ bindRemote ]--
|
||||
|
||||
sub bindRemote ($$)
|
||||
{
|
||||
my ($in_remotehost, $in_remoteport) = @_;
|
||||
my $proto = getprotobyname('tcp');
|
||||
my $that;
|
||||
my ($name, $aliases,$type,$len,$thataddr) = gethostbyname($in_remotehost);
|
||||
|
||||
if (!socket(ClientSocket,AF_INET, SOCK_STREAM, $proto)) {
|
||||
print "IRCD UNKNOWN: Could not start socket ($!)\n";
|
||||
exit $ERRORS{"UNKNOWN"};
|
||||
}
|
||||
$that = pack_sockaddr_in ($in_remoteport, $thataddr);
|
||||
if (!connect(ClientSocket, $that)) {
|
||||
print "IRCD UNKNOWN: Could not connect socket ($!)\n";
|
||||
exit $ERRORS{"UNKNOWN"};
|
||||
}
|
||||
select(ClientSocket); $| = 1; select(STDOUT);
|
||||
return \*ClientSocket;
|
||||
}
|
||||
|
||||
# ===================================================================[ MAIN ]==
|
||||
|
||||
MAIN:
|
||||
|
@ -177,6 +159,8 @@ MAIN:
|
|||
"w=i" => \$opt_w, "warning=i" => \$opt_w,
|
||||
"c=i" => \$opt_c, "critical=i" => \$opt_c,
|
||||
"p=i" => \$opt_p, "port=i" => \$opt_p,
|
||||
"4" => \$opt_4, "use-ipv4" => \$opt_4,
|
||||
"6" => \$opt_6, "use-ipv6" => \$opt_6,
|
||||
"H=s" => \$opt_H, "hostname=s" => \$opt_H);
|
||||
|
||||
if ($opt_V) {
|
||||
|
@ -187,7 +171,7 @@ MAIN:
|
|||
if ($opt_h) {print_help(); exit $ERRORS{'UNKNOWN'};}
|
||||
|
||||
($opt_H) || ($opt_H = shift @ARGV) || usage("Host name/address not specified\n");
|
||||
my $remotehost = $1 if ($opt_H =~ /([-.A-Za-z0-9]+)/);
|
||||
my $remotehost = $1 if ($opt_H =~ /([-.:%A-Za-z0-9]+)/);
|
||||
($remotehost) || usage("Invalid host: $opt_H\n");
|
||||
|
||||
($opt_w) || ($opt_w = shift @ARGV) || ($opt_w = 50);
|
||||
|
@ -212,21 +196,28 @@ MAIN:
|
|||
|
||||
alarm($TIMEOUT);
|
||||
|
||||
my ($name, $alias, $proto) = getprotobyname('tcp');
|
||||
|
||||
print "MAIN(debug): binding to remote host: $remotehost -> $remoteport\n" if $verbose;
|
||||
my $ClientSocket = &bindRemote($remotehost,$remoteport);
|
||||
$ClientSocket = IO::Socket::IP->new(
|
||||
PeerHost => $remotehost,
|
||||
PeerService => $remoteport,
|
||||
Family => $opt_4 ? AF_INET : $opt_6 ? AF_INET6 : undef,
|
||||
Type => SOCK_STREAM,
|
||||
);
|
||||
if (!$ClientSocket) {
|
||||
print "IRCD UNKNOWN: Could not start socket ($!)\n";
|
||||
exit $ERRORS{"UNKNOWN"};
|
||||
}
|
||||
|
||||
print ClientSocket "NICK $NICK\nUSER $USER_INFO\n";
|
||||
print $ClientSocket "NICK $NICK\nUSER $USER_INFO\n";
|
||||
|
||||
while (<ClientSocket>) {
|
||||
while (<$ClientSocket>) {
|
||||
print "MAIN(debug): default var = $_\n" if $verbose;
|
||||
|
||||
# DALnet,LagNet,UnderNet etc. Require this!
|
||||
# Replies with a PONG when presented with a PING query.
|
||||
# If a server doesn't require it, it will be ignored.
|
||||
|
||||
if (m/^PING (.*)/) {print ClientSocket "PONG $1\n";}
|
||||
if (m/^PING (.*)/) {print $ClientSocket "PONG $1\n";}
|
||||
|
||||
alarm(0);
|
||||
|
||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -47,7 +47,7 @@ print_help() {
|
|||
echo "--cache"
|
||||
echo " Check local database for library and buffer cache hit ratios"
|
||||
echo " ---> Requires Oracle user/password and SID specified."
|
||||
echo " ---> Requires select on v_$sysstat and v_$librarycache"
|
||||
echo " ---> Requires select on v_\$sysstat and v_\$librarycache"
|
||||
echo "--tablespace"
|
||||
echo " Check local database for tablespace capacity in ORACLE_SID"
|
||||
echo " ---> Requires Oracle user/password specified."
|
||||
|
@ -109,14 +109,14 @@ if [ -z "$ORACLE_HOME" ] ; then
|
|||
for oratab in /var/opt/oracle/oratab /etc/oratab
|
||||
do
|
||||
[ ! -f $oratab ] && continue
|
||||
ORACLE_HOME=`IFS=:
|
||||
while read -r SID ORACLE_HOME junk;
|
||||
ORACLE_HOME=$(IFS=:
|
||||
while read -r SID ORACLE_HOME _;
|
||||
do
|
||||
if [ "$SID" = "$2" ] || [ "$SID" = "*" ] ; then
|
||||
echo "$ORACLE_HOME";
|
||||
exit;
|
||||
fi;
|
||||
done < $oratab`
|
||||
done < $oratab)
|
||||
[ -n "$ORACLE_HOME" ] && break
|
||||
done
|
||||
fi
|
||||
|
@ -209,7 +209,7 @@ case "$cmd" in
|
|||
echo "UNKNOWN - Warning level is less then Crit"
|
||||
exit "$STATE_UNKNOWN"
|
||||
fi
|
||||
result=`sqlplus -s "${3}"/"${4}"@"${2}" << EOF
|
||||
result=$(sqlplus -s "${3}"/"${4}"@"${2}" << EOF
|
||||
set pagesize 0
|
||||
set numf '9999999.99'
|
||||
select (1-(pr.value/(dbg.value+cg.value)))*100
|
||||
|
@ -217,7 +217,8 @@ from v\\$sysstat pr, v\\$sysstat dbg, v\\$sysstat cg
|
|||
where pr.name='physical reads'
|
||||
and dbg.name='db block gets'
|
||||
and cg.name='consistent gets';
|
||||
EOF`
|
||||
EOF
|
||||
)
|
||||
|
||||
if echo "$result" | grep -q 'ORA-' ; then
|
||||
error=$(echo "$result" | grep "ORA-" | head -1)
|
||||
|
@ -227,12 +228,13 @@ EOF`
|
|||
|
||||
buf_hr=$(echo "$result" | awk '/^[0-9\. \t]+$/ {print int($1)}')
|
||||
buf_hrx=$(echo "$result" | awk '/^[0-9\. \t]+$/ {print $1}')
|
||||
result=`sqlplus -s "${3}"/"${4}"@"${2}" << EOF
|
||||
result=$(sqlplus -s "${3}"/"${4}"@"${2}" << EOF
|
||||
set pagesize 0
|
||||
set numf '9999999.99'
|
||||
select sum(lc.pins)/(sum(lc.pins)+sum(lc.reloads))*100
|
||||
from v\\$librarycache lc;
|
||||
EOF`
|
||||
EOF
|
||||
)
|
||||
|
||||
if echo "$result" | grep -q 'ORA-' ; then
|
||||
error=$(echo "$result" | grep "ORA-" | head -1)
|
||||
|
@ -260,7 +262,7 @@ EOF`
|
|||
echo "UNKNOWN - Warning level is more then Crit"
|
||||
exit "$STATE_UNKNOWN"
|
||||
fi
|
||||
result=`sqlplus -s "${3}"/"${4}"@"${2}" << EOF
|
||||
result=$(sqlplus -s "${3}"/"${4}"@"${2}" << EOF
|
||||
set pagesize 0
|
||||
set numf '9999999.99'
|
||||
select NVL(b.free,0.0),a.total,100 - trunc(NVL(b.free,0.0)/a.total * 1000) / 10 prc
|
||||
|
@ -271,7 +273,8 @@ LEFT OUTER JOIN
|
|||
( select tablespace_name,sum(bytes)/1024/1024 free
|
||||
from dba_free_space group by tablespace_name) B
|
||||
ON a.tablespace_name=b.tablespace_name WHERE a.tablespace_name='${5}';
|
||||
EOF`
|
||||
EOF
|
||||
)
|
||||
|
||||
if echo "$result" | grep -q 'ORA-' ; then
|
||||
error=$(echo "$result" | grep "ORA-" | head -1)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue