Compare commits

...

4 commits

Author SHA1 Message Date
Jan Wagner 3503b7a1c2 Adding symlinks 2020-10-26 19:46:17 +01:00
Jan Wagner 5c7d0029b2 d/control: Update 2020-10-26 19:31:22 +01:00
Jan Wagner 08024408fb d/copyright: Auto update 2020-10-26 19:31:06 +01:00
Jan Wagner 803d4b93cd Adding check_interfaces 2020-10-26 18:11:07 +01:00
20 changed files with 13015 additions and 20 deletions

16
check_interfaces/Makefile Normal file
View file

@ -0,0 +1,16 @@
PLUGIN := check_interfaces
CLEANFILES := check_interfaces
include ../common.mk
check_interfaces:
#set -e; for i in guess sub; do if [ ! -e src/config.$$i.bak ]; then cp src/config.$$i src/config.$$i.bak; fi; done
cp /usr/share/misc/config.* src
cd src && ./configure --disable-maintainer-mode --prefix=/usr --with-nagios-user=nagios --with-nagios-group=nagios
make -C src
#sed 's,^# nagios: +epn,# nagios: -epn\n,' src/plugins-scripts/check_interfaces > $@
cp src/check_interfaces $@
clean::
[ ! -f src/Makefile ] || make -C src distclean
set -e; for i in guess sub; do if [ -e src/config.$$i.bak ]; then mv src/config.$$i.bak src/config.$$i; fi; done

View file

@ -0,0 +1,339 @@
GNU GENERAL PUBLIC LICENSE
Version 2, June 1991
Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The licenses for most software are designed to take away your
freedom to share and change it. By contrast, the GNU General Public
License is intended to guarantee your freedom to share and change free
software--to make sure the software is free for all its users. This
General Public License applies to most of the Free Software
Foundation's software and to any other program whose authors commit to
using it. (Some other Free Software Foundation software is covered by
the GNU Lesser General Public License instead.) You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
this service if you wish), that you receive source code or can get it
if you want it, that you can change the software or use pieces of it
in new free programs; and that you know you can do these things.
To protect your rights, we need to make restrictions that forbid
anyone to deny you these rights or to ask you to surrender the rights.
These restrictions translate to certain responsibilities for you if you
distribute copies of the software, or if you modify it.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must give the recipients all the rights that
you have. You must make sure that they, too, receive or can get the
source code. And you must show them these terms so they know their
rights.
We protect your rights with two steps: (1) copyright the software, and
(2) offer you this license which gives you legal permission to copy,
distribute and/or modify the software.
Also, for each author's protection and ours, we want to make certain
that everyone understands that there is no warranty for this free
software. If the software is modified by someone else and passed on, we
want its recipients to know that what they have is not the original, so
that any problems introduced by others will not reflect on the original
authors' reputations.
Finally, any free program is threatened constantly by software
patents. We wish to avoid the danger that redistributors of a free
program will individually obtain patent licenses, in effect making the
program proprietary. To prevent this, we have made it clear that any
patent must be licensed for everyone's free use or not licensed at all.
The precise terms and conditions for copying, distribution and
modification follow.
GNU GENERAL PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. This License applies to any program or other work which contains
a notice placed by the copyright holder saying it may be distributed
under the terms of this General Public License. The "Program", below,
refers to any such program or work, and a "work based on the Program"
means either the Program or any derivative work under copyright law:
that is to say, a work containing the Program or a portion of it,
either verbatim or with modifications and/or translated into another
language. (Hereinafter, translation is included without limitation in
the term "modification".) Each licensee is addressed as "you".
Activities other than copying, distribution and modification are not
covered by this License; they are outside its scope. The act of
running the Program is not restricted, and the output from the Program
is covered only if its contents constitute a work based on the
Program (independent of having been made by running the Program).
Whether that is true depends on what the Program does.
1. You may copy and distribute verbatim copies of the Program's
source code as you receive it, in any medium, provided that you
conspicuously and appropriately publish on each copy an appropriate
copyright notice and disclaimer of warranty; keep intact all the
notices that refer to this License and to the absence of any warranty;
and give any other recipients of the Program a copy of this License
along with the Program.
You may charge a fee for the physical act of transferring a copy, and
you may at your option offer warranty protection in exchange for a fee.
2. You may modify your copy or copies of the Program or any portion
of it, thus forming a work based on the Program, and copy and
distribute such modifications or work under the terms of Section 1
above, provided that you also meet all of these conditions:
a) You must cause the modified files to carry prominent notices
stating that you changed the files and the date of any change.
b) You must cause any work that you distribute or publish, that in
whole or in part contains or is derived from the Program or any
part thereof, to be licensed as a whole at no charge to all third
parties under the terms of this License.
c) If the modified program normally reads commands interactively
when run, you must cause it, when started running for such
interactive use in the most ordinary way, to print or display an
announcement including an appropriate copyright notice and a
notice that there is no warranty (or else, saying that you provide
a warranty) and that users may redistribute the program under
these conditions, and telling the user how to view a copy of this
License. (Exception: if the Program itself is interactive but
does not normally print such an announcement, your work based on
the Program is not required to print an announcement.)
These requirements apply to the modified work as a whole. If
identifiable sections of that work are not derived from the Program,
and can be reasonably considered independent and separate works in
themselves, then this License, and its terms, do not apply to those
sections when you distribute them as separate works. But when you
distribute the same sections as part of a whole which is a work based
on the Program, the distribution of the whole must be on the terms of
this License, whose permissions for other licensees extend to the
entire whole, and thus to each and every part regardless of who wrote it.
Thus, it is not the intent of this section to claim rights or contest
your rights to work written entirely by you; rather, the intent is to
exercise the right to control the distribution of derivative or
collective works based on the Program.
In addition, mere aggregation of another work not based on the Program
with the Program (or with a work based on the Program) on a volume of
a storage or distribution medium does not bring the other work under
the scope of this License.
3. You may copy and distribute the Program (or a work based on it,
under Section 2) in object code or executable form under the terms of
Sections 1 and 2 above provided that you also do one of the following:
a) Accompany it with the complete corresponding machine-readable
source code, which must be distributed under the terms of Sections
1 and 2 above on a medium customarily used for software interchange; or,
b) Accompany it with a written offer, valid for at least three
years, to give any third party, for a charge no more than your
cost of physically performing source distribution, a complete
machine-readable copy of the corresponding source code, to be
distributed under the terms of Sections 1 and 2 above on a medium
customarily used for software interchange; or,
c) Accompany it with the information you received as to the offer
to distribute corresponding source code. (This alternative is
allowed only for noncommercial distribution and only if you
received the program in object code or executable form with such
an offer, in accord with Subsection b above.)
The source code for a work means the preferred form of the work for
making modifications to it. For an executable work, complete source
code means all the source code for all modules it contains, plus any
associated interface definition files, plus the scripts used to
control compilation and installation of the executable. However, as a
special exception, the source code distributed need not include
anything that is normally distributed (in either source or binary
form) with the major components (compiler, kernel, and so on) of the
operating system on which the executable runs, unless that component
itself accompanies the executable.
If distribution of executable or object code is made by offering
access to copy from a designated place, then offering equivalent
access to copy the source code from the same place counts as
distribution of the source code, even though third parties are not
compelled to copy the source along with the object code.
4. You may not copy, modify, sublicense, or distribute the Program
except as expressly provided under this License. Any attempt
otherwise to copy, modify, sublicense or distribute the Program is
void, and will automatically terminate your rights under this License.
However, parties who have received copies, or rights, from you under
this License will not have their licenses terminated so long as such
parties remain in full compliance.
5. You are not required to accept this License, since you have not
signed it. However, nothing else grants you permission to modify or
distribute the Program or its derivative works. These actions are
prohibited by law if you do not accept this License. Therefore, by
modifying or distributing the Program (or any work based on the
Program), you indicate your acceptance of this License to do so, and
all its terms and conditions for copying, distributing or modifying
the Program or works based on it.
6. Each time you redistribute the Program (or any work based on the
Program), the recipient automatically receives a license from the
original licensor to copy, distribute or modify the Program subject to
these terms and conditions. You may not impose any further
restrictions on the recipients' exercise of the rights granted herein.
You are not responsible for enforcing compliance by third parties to
this License.
7. If, as a consequence of a court judgment or allegation of patent
infringement or for any other reason (not limited to patent issues),
conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot
distribute so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you
may not distribute the Program at all. For example, if a patent
license would not permit royalty-free redistribution of the Program by
all those who receive copies directly or indirectly through you, then
the only way you could satisfy both it and this License would be to
refrain entirely from distribution of the Program.
If any portion of this section is held invalid or unenforceable under
any particular circumstance, the balance of the section is intended to
apply and the section as a whole is intended to apply in other
circumstances.
It is not the purpose of this section to induce you to infringe any
patents or other property right claims or to contest validity of any
such claims; this section has the sole purpose of protecting the
integrity of the free software distribution system, which is
implemented by public license practices. Many people have made
generous contributions to the wide range of software distributed
through that system in reliance on consistent application of that
system; it is up to the author/donor to decide if he or she is willing
to distribute software through any other system and a licensee cannot
impose that choice.
This section is intended to make thoroughly clear what is believed to
be a consequence of the rest of this License.
8. If the distribution and/or use of the Program is restricted in
certain countries either by patents or by copyrighted interfaces, the
original copyright holder who places the Program under this License
may add an explicit geographical distribution limitation excluding
those countries, so that distribution is permitted only in or among
countries not thus excluded. In such case, this License incorporates
the limitation as if written in the body of this License.
9. The Free Software Foundation may publish revised and/or new versions
of the General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the Program
specifies a version number of this License which applies to it and "any
later version", you have the option of following the terms and conditions
either of that version or of any later version published by the Free
Software Foundation. If the Program does not specify a version number of
this License, you may choose any version ever published by the Free Software
Foundation.
10. If you wish to incorporate parts of the Program into other free
programs whose distribution conditions are different, write to the author
to ask for permission. For software which is copyrighted by the Free
Software Foundation, write to the Free Software Foundation; we sometimes
make exceptions for this. Our decision will be guided by the two goals
of preserving the free status of all derivatives of our free software and
of promoting the sharing and reuse of software generally.
NO WARRANTY
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
REPAIR OR CORRECTION.
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
POSSIBILITY OF SUCH DAMAGES.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
convey the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
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, 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.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
Also add information on how to contact you by electronic and paper mail.
If the program is interactive, make it output a short notice like this
when it starts in an interactive mode:
Gnomovision version 69, Copyright (C) year name of author
Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, the commands you use may
be called something other than `show w' and `show c'; they could even be
mouse-clicks or menu items--whatever suits your program.
You should also get your employer (if you work as a programmer) or your
school, if any, to sign a "copyright disclaimer" for the program, if
necessary. Here is a sample; alter the names:
Yoyodyne, Inc., hereby disclaims all copyright interest in the program
`Gnomovision' (which makes passes at compilers) written by James Hacker.
<signature of Ty Coon>, 1 April 1989
Ty Coon, President of Vice
This General Public License does not permit incorporating your program into
proprietary programs. If your program is a subroutine library, you may
consider it more useful to permit linking proprietary applications with the
library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License.

View file

@ -0,0 +1,39 @@
CC=@CC@
prefix=@prefix@
exec_prefix=@exec_prefix@
INSTALL=@INSTALL@
DESTDIR=@libexecdir@
OBJS=snmp_bulkget.o utils.o
TARGET=check_interfaces
CPPFLAGS=@CPPFLAGS@
LDFLAGS=@LDFLAGS@ -lrt
CFLAGS=@CFLAGS@ @DEFS@
# shared library flags (assumes gcc)
# DLFLAGS=-fPIC -shared
BUILDLIBS=@SNMP_LIBS@ @LIBS@
.PHONY: debug clean all install
all: build strip
build: $(TARGET)
$(TARGET): $(OBJS)
$(CC) -o $(TARGET) $(OBJS) $(LDFLAGS) $(BUILDLIBS)
strip:
strip $(TARGET)
debug: CFLAGS += -DDEBUG -g -O0
debug: LDFLAGS += -g -O0
debug: build
clean:
rm $(OBJS) $(TARGET)
install: all
$(INSTALL) -t $(DESTDIR) $(TARGET)

View file

@ -0,0 +1,115 @@
check_interfaces
================
This plugin uses the bulk-get mode of SNMPv2 by default - pass it the option -m NONBULK to work with SNMPv1. Support for SNMPv3 with and without privacy is included.
64 bit counters will be used if they are supported by the device.
### Installation
In order to compile this plugin you will need the `NET SNMP Development` package
(libsnmp-dev under Debian) as well as `autoconf` and the standard compilation tools.
Download and extract the tarball from https://www.netways.org/projects/check-interfaces/files
autoconf (only needed if the configure script has not been created)
./configure
Running "make" should successfully compile the plugin, and "make install" will install them under
the configured path.
make
make install
### Usage
(see also check_interface --help)
check_interface -c public -h 192.168.0.1 -r 'FastEth' -p '$SERVICEPERFDATA$' -t $LASTSERVICECHECK$ -a
Options;
-h address of device
-c|--community community (default public)
-r|--regex interface list regexp
Regex to match interfaces (important, this is a Regular Expression
not a simple wildcard string, see below)
-e|--errors number of in errors (CRC errors for cisco) to consider a warning (default 50)
Only warn if errors increase by more than this amount between checks
-f|--out-errors number of out errors (collisions for cisco) to consider a warning
Defaults to the same value as for errors
-p|--perfdata last check perfdata
Performance data from previous check (used to calculate traffic)
-P|--prefix prefix interface names with this label
-t|--lastcheck last checktime (unixtime)
Last service check time in unixtime (also used to calculate traffic)
-b|--bandwidth bandwidth warn level in %
-s|--speed override speed detection with this value (bits per sec)
-x|--trim cut this number of characters from the start of interface descriptions
Useful for nortel switches
-j|--auth-proto SNMPv3 Auth Protocol (SHA|MD5)
-J|--auth-phrase SNMPv3 Auth Phrase
-k|--priv-proto SNMPv3 Privacy Protocol (AES|DES) (optional)
-K|--priv-phrase SNMPv3 Privacy Phrase
-u|--user SNMPv3 User
-d|--down-is-ok disables critical alerts for down interfaces
i.e do not consider a down interface to be critical
-a|--aliases retrieves the interface description
This alias does not always deliver useful information
-A|--match-aliases also test the Alias against the Regexes
-D|--debug-print list administrative down interfaces in perfdata
-N|--if-names use ifName instead of ifDescr
--timeout sets the SNMP timeout (in ms)
-m|--mode special operating mode (default,cisco,nonbulk,bintec)
Workarounds for various hardware
### Modes
default use SNMPv2 bulk-gets to retrieve the interface list (recommended for devices with many interfaces)
cisco retrieve CRC errors and collisions instead of in errors and out errors
bintec work with non-RFC Bintec devices
nonbulk use a traditional tree-walk and SNMPv1 instead of bulk-gets (less efficient, but works with most devices)
### Counter Overflows
The plugin will query the uptime of the device and compensate for counter overflows.
Note however that a 1Gbit interface with a 32 bit counter will overflow every 34 seconds
if the interface is operating at full capacity - in this case you will need to query the
device at least once a minute. With 64 bit counters these problems go away.
Also be aware that the counter values themselves are passed unaltered in the performance
data field - if you graph the data then the grapher also needs to be overflow aware.
### Large Plugin Output
Be aware that this plugin may generate large outputs. Your version of Nagios / Icinga may cut off the output and cause you problems with various graphing tools; for best results restrict the list of interfaces using the -r option
### Regular Expressions
The following patterns can be used to match strings
. anything
^ beginning of string
$ end of string (WARNING: you need to use $$ in a Nagios configuration file!)
(abc|def) either abc or def
[0-9a-z] a range
* the previous pattern multiple times
Examples;
Eth match any strings containing "Eth"
^FastEth match any strings beginning with "FastEth"
Eth(0|2)$ match Eth0 or Eth2
Eth(0|2) as above but would also match Eth20, Eth21, Eth22 etc
If unsure of a pattern, you should test it on the command line thus;
check_interface -c public -h 192.168.0.1 -r 'Eth(0|2)$'

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,77 @@
# This file was generated.
# It contains the lists of macros which have been traced.
# It can be safely removed.
@request = (
bless( [
'0',
1,
[
'/usr/share/autoconf'
],
[
'/usr/share/autoconf/autoconf/autoconf.m4f',
'configure.ac'
],
{
'_AM_COND_ELSE' => 1,
'_LT_AC_TAGCONFIG' => 1,
'AC_CANONICAL_SYSTEM' => 1,
'AC_CONFIG_SUBDIRS' => 1,
'AC_CONFIG_AUX_DIR' => 1,
'_AM_SUBST_NOTMAKE' => 1,
'sinclude' => 1,
'_AM_COND_IF' => 1,
'AM_MAINTAINER_MODE' => 1,
'AC_FC_FREEFORM' => 1,
'AC_CONFIG_LIBOBJ_DIR' => 1,
'AM_ENABLE_MULTILIB' => 1,
'LT_INIT' => 1,
'AC_CANONICAL_TARGET' => 1,
'AM_PROG_CC_C_O' => 1,
'AM_PROG_MOC' => 1,
'AC_CONFIG_FILES' => 1,
'AC_CONFIG_LINKS' => 1,
'AC_SUBST' => 1,
'AM_NLS' => 1,
'AC_REQUIRE_AUX_FILE' => 1,
'AM_INIT_AUTOMAKE' => 1,
'LT_SUPPORTED_TAG' => 1,
'AC_INIT' => 1,
'AM_GNU_GETTEXT_INTL_SUBDIR' => 1,
'AC_FC_PP_SRCEXT' => 1,
'AM_AUTOMAKE_VERSION' => 1,
'_m4_warn' => 1,
'm4_pattern_forbid' => 1,
'AM_GNU_GETTEXT' => 1,
'AC_CANONICAL_HOST' => 1,
'AM_PROG_FC_C_O' => 1,
'AC_LIBSOURCE' => 1,
'_AM_MAKEFILE_INCLUDE' => 1,
'AM_XGETTEXT_OPTION' => 1,
'AM_PROG_CXX_C_O' => 1,
'AM_POT_TOOLS' => 1,
'm4_pattern_allow' => 1,
'm4_sinclude' => 1,
'LT_CONFIG_LTDL_DIR' => 1,
'_AM_COND_ENDIF' => 1,
'AC_CANONICAL_BUILD' => 1,
'm4_include' => 1,
'AM_PROG_AR' => 1,
'AM_PATH_GUILE' => 1,
'AC_PROG_LIBTOOL' => 1,
'include' => 1,
'AC_DEFINE_TRACE_LITERAL' => 1,
'AM_PROG_F77_C_O' => 1,
'AC_FC_SRCEXT' => 1,
'AM_SILENT_RULES' => 1,
'AM_MAKEFILE_INCLUDE' => 1,
'AH_OUTPUT' => 1,
'AC_FC_PP_DEFINE' => 1,
'AM_CONDITIONAL' => 1,
'AC_CONFIG_HEADERS' => 1,
'AC_SUBST_TRACE' => 1
}
], 'Autom4te::Request' )
);

View file

@ -0,0 +1,266 @@
m4trace:configure.ac:1: -1- AC_INIT([check_interfaces], [1.4])
m4trace:configure.ac:1: -1- m4_pattern_forbid([^_?A[CHUM]_])
m4trace:configure.ac:1: -1- m4_pattern_forbid([_AC_])
m4trace:configure.ac:1: -1- m4_pattern_forbid([^LIBOBJS$], [do not use LIBOBJS directly, use AC_LIBOBJ (see section `AC_LIBOBJ vs LIBOBJS'])
m4trace:configure.ac:1: -1- m4_pattern_allow([^AS_FLAGS$])
m4trace:configure.ac:1: -1- m4_pattern_forbid([^_?m4_])
m4trace:configure.ac:1: -1- m4_pattern_forbid([^dnl$])
m4trace:configure.ac:1: -1- m4_pattern_forbid([^_?AS_])
m4trace:configure.ac:1: -1- AC_SUBST([SHELL])
m4trace:configure.ac:1: -1- AC_SUBST_TRACE([SHELL])
m4trace:configure.ac:1: -1- m4_pattern_allow([^SHELL$])
m4trace:configure.ac:1: -1- AC_SUBST([PATH_SEPARATOR])
m4trace:configure.ac:1: -1- AC_SUBST_TRACE([PATH_SEPARATOR])
m4trace:configure.ac:1: -1- m4_pattern_allow([^PATH_SEPARATOR$])
m4trace:configure.ac:1: -1- AC_SUBST([PACKAGE_NAME], [m4_ifdef([AC_PACKAGE_NAME], ['AC_PACKAGE_NAME'])])
m4trace:configure.ac:1: -1- AC_SUBST_TRACE([PACKAGE_NAME])
m4trace:configure.ac:1: -1- m4_pattern_allow([^PACKAGE_NAME$])
m4trace:configure.ac:1: -1- AC_SUBST([PACKAGE_TARNAME], [m4_ifdef([AC_PACKAGE_TARNAME], ['AC_PACKAGE_TARNAME'])])
m4trace:configure.ac:1: -1- AC_SUBST_TRACE([PACKAGE_TARNAME])
m4trace:configure.ac:1: -1- m4_pattern_allow([^PACKAGE_TARNAME$])
m4trace:configure.ac:1: -1- AC_SUBST([PACKAGE_VERSION], [m4_ifdef([AC_PACKAGE_VERSION], ['AC_PACKAGE_VERSION'])])
m4trace:configure.ac:1: -1- AC_SUBST_TRACE([PACKAGE_VERSION])
m4trace:configure.ac:1: -1- m4_pattern_allow([^PACKAGE_VERSION$])
m4trace:configure.ac:1: -1- AC_SUBST([PACKAGE_STRING], [m4_ifdef([AC_PACKAGE_STRING], ['AC_PACKAGE_STRING'])])
m4trace:configure.ac:1: -1- AC_SUBST_TRACE([PACKAGE_STRING])
m4trace:configure.ac:1: -1- m4_pattern_allow([^PACKAGE_STRING$])
m4trace:configure.ac:1: -1- AC_SUBST([PACKAGE_BUGREPORT], [m4_ifdef([AC_PACKAGE_BUGREPORT], ['AC_PACKAGE_BUGREPORT'])])
m4trace:configure.ac:1: -1- AC_SUBST_TRACE([PACKAGE_BUGREPORT])
m4trace:configure.ac:1: -1- m4_pattern_allow([^PACKAGE_BUGREPORT$])
m4trace:configure.ac:1: -1- AC_SUBST([PACKAGE_URL], [m4_ifdef([AC_PACKAGE_URL], ['AC_PACKAGE_URL'])])
m4trace:configure.ac:1: -1- AC_SUBST_TRACE([PACKAGE_URL])
m4trace:configure.ac:1: -1- m4_pattern_allow([^PACKAGE_URL$])
m4trace:configure.ac:1: -1- AC_SUBST([exec_prefix], [NONE])
m4trace:configure.ac:1: -1- AC_SUBST_TRACE([exec_prefix])
m4trace:configure.ac:1: -1- m4_pattern_allow([^exec_prefix$])
m4trace:configure.ac:1: -1- AC_SUBST([prefix], [NONE])
m4trace:configure.ac:1: -1- AC_SUBST_TRACE([prefix])
m4trace:configure.ac:1: -1- m4_pattern_allow([^prefix$])
m4trace:configure.ac:1: -1- AC_SUBST([program_transform_name], [s,x,x,])
m4trace:configure.ac:1: -1- AC_SUBST_TRACE([program_transform_name])
m4trace:configure.ac:1: -1- m4_pattern_allow([^program_transform_name$])
m4trace:configure.ac:1: -1- AC_SUBST([bindir], ['${exec_prefix}/bin'])
m4trace:configure.ac:1: -1- AC_SUBST_TRACE([bindir])
m4trace:configure.ac:1: -1- m4_pattern_allow([^bindir$])
m4trace:configure.ac:1: -1- AC_SUBST([sbindir], ['${exec_prefix}/sbin'])
m4trace:configure.ac:1: -1- AC_SUBST_TRACE([sbindir])
m4trace:configure.ac:1: -1- m4_pattern_allow([^sbindir$])
m4trace:configure.ac:1: -1- AC_SUBST([libexecdir], ['${exec_prefix}/libexec'])
m4trace:configure.ac:1: -1- AC_SUBST_TRACE([libexecdir])
m4trace:configure.ac:1: -1- m4_pattern_allow([^libexecdir$])
m4trace:configure.ac:1: -1- AC_SUBST([datarootdir], ['${prefix}/share'])
m4trace:configure.ac:1: -1- AC_SUBST_TRACE([datarootdir])
m4trace:configure.ac:1: -1- m4_pattern_allow([^datarootdir$])
m4trace:configure.ac:1: -1- AC_SUBST([datadir], ['${datarootdir}'])
m4trace:configure.ac:1: -1- AC_SUBST_TRACE([datadir])
m4trace:configure.ac:1: -1- m4_pattern_allow([^datadir$])
m4trace:configure.ac:1: -1- AC_SUBST([sysconfdir], ['${prefix}/etc'])
m4trace:configure.ac:1: -1- AC_SUBST_TRACE([sysconfdir])
m4trace:configure.ac:1: -1- m4_pattern_allow([^sysconfdir$])
m4trace:configure.ac:1: -1- AC_SUBST([sharedstatedir], ['${prefix}/com'])
m4trace:configure.ac:1: -1- AC_SUBST_TRACE([sharedstatedir])
m4trace:configure.ac:1: -1- m4_pattern_allow([^sharedstatedir$])
m4trace:configure.ac:1: -1- AC_SUBST([localstatedir], ['${prefix}/var'])
m4trace:configure.ac:1: -1- AC_SUBST_TRACE([localstatedir])
m4trace:configure.ac:1: -1- m4_pattern_allow([^localstatedir$])
m4trace:configure.ac:1: -1- AC_SUBST([includedir], ['${prefix}/include'])
m4trace:configure.ac:1: -1- AC_SUBST_TRACE([includedir])
m4trace:configure.ac:1: -1- m4_pattern_allow([^includedir$])
m4trace:configure.ac:1: -1- AC_SUBST([oldincludedir], ['/usr/include'])
m4trace:configure.ac:1: -1- AC_SUBST_TRACE([oldincludedir])
m4trace:configure.ac:1: -1- m4_pattern_allow([^oldincludedir$])
m4trace:configure.ac:1: -1- AC_SUBST([docdir], [m4_ifset([AC_PACKAGE_TARNAME],
['${datarootdir}/doc/${PACKAGE_TARNAME}'],
['${datarootdir}/doc/${PACKAGE}'])])
m4trace:configure.ac:1: -1- AC_SUBST_TRACE([docdir])
m4trace:configure.ac:1: -1- m4_pattern_allow([^docdir$])
m4trace:configure.ac:1: -1- AC_SUBST([infodir], ['${datarootdir}/info'])
m4trace:configure.ac:1: -1- AC_SUBST_TRACE([infodir])
m4trace:configure.ac:1: -1- m4_pattern_allow([^infodir$])
m4trace:configure.ac:1: -1- AC_SUBST([htmldir], ['${docdir}'])
m4trace:configure.ac:1: -1- AC_SUBST_TRACE([htmldir])
m4trace:configure.ac:1: -1- m4_pattern_allow([^htmldir$])
m4trace:configure.ac:1: -1- AC_SUBST([dvidir], ['${docdir}'])
m4trace:configure.ac:1: -1- AC_SUBST_TRACE([dvidir])
m4trace:configure.ac:1: -1- m4_pattern_allow([^dvidir$])
m4trace:configure.ac:1: -1- AC_SUBST([pdfdir], ['${docdir}'])
m4trace:configure.ac:1: -1- AC_SUBST_TRACE([pdfdir])
m4trace:configure.ac:1: -1- m4_pattern_allow([^pdfdir$])
m4trace:configure.ac:1: -1- AC_SUBST([psdir], ['${docdir}'])
m4trace:configure.ac:1: -1- AC_SUBST_TRACE([psdir])
m4trace:configure.ac:1: -1- m4_pattern_allow([^psdir$])
m4trace:configure.ac:1: -1- AC_SUBST([libdir], ['${exec_prefix}/lib'])
m4trace:configure.ac:1: -1- AC_SUBST_TRACE([libdir])
m4trace:configure.ac:1: -1- m4_pattern_allow([^libdir$])
m4trace:configure.ac:1: -1- AC_SUBST([localedir], ['${datarootdir}/locale'])
m4trace:configure.ac:1: -1- AC_SUBST_TRACE([localedir])
m4trace:configure.ac:1: -1- m4_pattern_allow([^localedir$])
m4trace:configure.ac:1: -1- AC_SUBST([mandir], ['${datarootdir}/man'])
m4trace:configure.ac:1: -1- AC_SUBST_TRACE([mandir])
m4trace:configure.ac:1: -1- m4_pattern_allow([^mandir$])
m4trace:configure.ac:1: -1- AC_DEFINE_TRACE_LITERAL([PACKAGE_NAME])
m4trace:configure.ac:1: -1- m4_pattern_allow([^PACKAGE_NAME$])
m4trace:configure.ac:1: -1- AH_OUTPUT([PACKAGE_NAME], [/* Define to the full name of this package. */
@%:@undef PACKAGE_NAME])
m4trace:configure.ac:1: -1- AC_DEFINE_TRACE_LITERAL([PACKAGE_TARNAME])
m4trace:configure.ac:1: -1- m4_pattern_allow([^PACKAGE_TARNAME$])
m4trace:configure.ac:1: -1- AH_OUTPUT([PACKAGE_TARNAME], [/* Define to the one symbol short name of this package. */
@%:@undef PACKAGE_TARNAME])
m4trace:configure.ac:1: -1- AC_DEFINE_TRACE_LITERAL([PACKAGE_VERSION])
m4trace:configure.ac:1: -1- m4_pattern_allow([^PACKAGE_VERSION$])
m4trace:configure.ac:1: -1- AH_OUTPUT([PACKAGE_VERSION], [/* Define to the version of this package. */
@%:@undef PACKAGE_VERSION])
m4trace:configure.ac:1: -1- AC_DEFINE_TRACE_LITERAL([PACKAGE_STRING])
m4trace:configure.ac:1: -1- m4_pattern_allow([^PACKAGE_STRING$])
m4trace:configure.ac:1: -1- AH_OUTPUT([PACKAGE_STRING], [/* Define to the full name and version of this package. */
@%:@undef PACKAGE_STRING])
m4trace:configure.ac:1: -1- AC_DEFINE_TRACE_LITERAL([PACKAGE_BUGREPORT])
m4trace:configure.ac:1: -1- m4_pattern_allow([^PACKAGE_BUGREPORT$])
m4trace:configure.ac:1: -1- AH_OUTPUT([PACKAGE_BUGREPORT], [/* Define to the address where bug reports for this package should be sent. */
@%:@undef PACKAGE_BUGREPORT])
m4trace:configure.ac:1: -1- AC_DEFINE_TRACE_LITERAL([PACKAGE_URL])
m4trace:configure.ac:1: -1- m4_pattern_allow([^PACKAGE_URL$])
m4trace:configure.ac:1: -1- AH_OUTPUT([PACKAGE_URL], [/* Define to the home page for this package. */
@%:@undef PACKAGE_URL])
m4trace:configure.ac:1: -1- AC_SUBST([DEFS])
m4trace:configure.ac:1: -1- AC_SUBST_TRACE([DEFS])
m4trace:configure.ac:1: -1- m4_pattern_allow([^DEFS$])
m4trace:configure.ac:1: -1- AC_SUBST([ECHO_C])
m4trace:configure.ac:1: -1- AC_SUBST_TRACE([ECHO_C])
m4trace:configure.ac:1: -1- m4_pattern_allow([^ECHO_C$])
m4trace:configure.ac:1: -1- AC_SUBST([ECHO_N])
m4trace:configure.ac:1: -1- AC_SUBST_TRACE([ECHO_N])
m4trace:configure.ac:1: -1- m4_pattern_allow([^ECHO_N$])
m4trace:configure.ac:1: -1- AC_SUBST([ECHO_T])
m4trace:configure.ac:1: -1- AC_SUBST_TRACE([ECHO_T])
m4trace:configure.ac:1: -1- m4_pattern_allow([^ECHO_T$])
m4trace:configure.ac:1: -1- AC_SUBST([LIBS])
m4trace:configure.ac:1: -1- AC_SUBST_TRACE([LIBS])
m4trace:configure.ac:1: -1- m4_pattern_allow([^LIBS$])
m4trace:configure.ac:1: -1- AC_SUBST([build_alias])
m4trace:configure.ac:1: -1- AC_SUBST_TRACE([build_alias])
m4trace:configure.ac:1: -1- m4_pattern_allow([^build_alias$])
m4trace:configure.ac:1: -1- AC_SUBST([host_alias])
m4trace:configure.ac:1: -1- AC_SUBST_TRACE([host_alias])
m4trace:configure.ac:1: -1- m4_pattern_allow([^host_alias$])
m4trace:configure.ac:1: -1- AC_SUBST([target_alias])
m4trace:configure.ac:1: -1- AC_SUBST_TRACE([target_alias])
m4trace:configure.ac:1: -1- m4_pattern_allow([^target_alias$])
m4trace:configure.ac:3: -1- AC_SUBST([CC])
m4trace:configure.ac:3: -1- AC_SUBST_TRACE([CC])
m4trace:configure.ac:3: -1- m4_pattern_allow([^CC$])
m4trace:configure.ac:3: -1- AC_SUBST([CFLAGS])
m4trace:configure.ac:3: -1- AC_SUBST_TRACE([CFLAGS])
m4trace:configure.ac:3: -1- m4_pattern_allow([^CFLAGS$])
m4trace:configure.ac:3: -1- AC_SUBST([LDFLAGS])
m4trace:configure.ac:3: -1- AC_SUBST_TRACE([LDFLAGS])
m4trace:configure.ac:3: -1- m4_pattern_allow([^LDFLAGS$])
m4trace:configure.ac:3: -1- AC_SUBST([LIBS])
m4trace:configure.ac:3: -1- AC_SUBST_TRACE([LIBS])
m4trace:configure.ac:3: -1- m4_pattern_allow([^LIBS$])
m4trace:configure.ac:3: -1- AC_SUBST([CPPFLAGS])
m4trace:configure.ac:3: -1- AC_SUBST_TRACE([CPPFLAGS])
m4trace:configure.ac:3: -1- m4_pattern_allow([^CPPFLAGS$])
m4trace:configure.ac:3: -1- AC_SUBST([CC])
m4trace:configure.ac:3: -1- AC_SUBST_TRACE([CC])
m4trace:configure.ac:3: -1- m4_pattern_allow([^CC$])
m4trace:configure.ac:3: -1- AC_SUBST([CC])
m4trace:configure.ac:3: -1- AC_SUBST_TRACE([CC])
m4trace:configure.ac:3: -1- m4_pattern_allow([^CC$])
m4trace:configure.ac:3: -1- AC_SUBST([CC])
m4trace:configure.ac:3: -1- AC_SUBST_TRACE([CC])
m4trace:configure.ac:3: -1- m4_pattern_allow([^CC$])
m4trace:configure.ac:3: -1- AC_SUBST([CC])
m4trace:configure.ac:3: -1- AC_SUBST_TRACE([CC])
m4trace:configure.ac:3: -1- m4_pattern_allow([^CC$])
m4trace:configure.ac:3: -1- AC_SUBST([ac_ct_CC])
m4trace:configure.ac:3: -1- AC_SUBST_TRACE([ac_ct_CC])
m4trace:configure.ac:3: -1- m4_pattern_allow([^ac_ct_CC$])
m4trace:configure.ac:3: -1- AC_SUBST([EXEEXT], [$ac_cv_exeext])
m4trace:configure.ac:3: -1- AC_SUBST_TRACE([EXEEXT])
m4trace:configure.ac:3: -1- m4_pattern_allow([^EXEEXT$])
m4trace:configure.ac:3: -1- AC_SUBST([OBJEXT], [$ac_cv_objext])
m4trace:configure.ac:3: -1- AC_SUBST_TRACE([OBJEXT])
m4trace:configure.ac:3: -1- m4_pattern_allow([^OBJEXT$])
m4trace:configure.ac:4: -1- AC_REQUIRE_AUX_FILE([install-sh])
m4trace:configure.ac:4: -1- AC_SUBST([INSTALL_PROGRAM])
m4trace:configure.ac:4: -1- AC_SUBST_TRACE([INSTALL_PROGRAM])
m4trace:configure.ac:4: -1- m4_pattern_allow([^INSTALL_PROGRAM$])
m4trace:configure.ac:4: -1- AC_SUBST([INSTALL_SCRIPT])
m4trace:configure.ac:4: -1- AC_SUBST_TRACE([INSTALL_SCRIPT])
m4trace:configure.ac:4: -1- m4_pattern_allow([^INSTALL_SCRIPT$])
m4trace:configure.ac:4: -1- AC_SUBST([INSTALL_DATA])
m4trace:configure.ac:4: -1- AC_SUBST_TRACE([INSTALL_DATA])
m4trace:configure.ac:4: -1- m4_pattern_allow([^INSTALL_DATA$])
m4trace:configure.ac:10: -1- AC_SUBST([NETSNMPCONFIG])
m4trace:configure.ac:10: -1- AC_SUBST_TRACE([NETSNMPCONFIG])
m4trace:configure.ac:10: -1- m4_pattern_allow([^NETSNMPCONFIG$])
m4trace:configure.ac:34: -1- AH_OUTPUT([HAVE_NET_SNMP_NET_SNMP_CONFIG_H], [/* Define to 1 if you have the <net-snmp/net-snmp-config.h> header file. */
@%:@undef HAVE_NET_SNMP_NET_SNMP_CONFIG_H])
m4trace:configure.ac:34: -1- AC_SUBST([CPP])
m4trace:configure.ac:34: -1- AC_SUBST_TRACE([CPP])
m4trace:configure.ac:34: -1- m4_pattern_allow([^CPP$])
m4trace:configure.ac:34: -1- AC_SUBST([CPPFLAGS])
m4trace:configure.ac:34: -1- AC_SUBST_TRACE([CPPFLAGS])
m4trace:configure.ac:34: -1- m4_pattern_allow([^CPPFLAGS$])
m4trace:configure.ac:34: -1- AC_SUBST([CPP])
m4trace:configure.ac:34: -1- AC_SUBST_TRACE([CPP])
m4trace:configure.ac:34: -1- m4_pattern_allow([^CPP$])
m4trace:configure.ac:34: -1- AC_SUBST([GREP])
m4trace:configure.ac:34: -1- AC_SUBST_TRACE([GREP])
m4trace:configure.ac:34: -1- m4_pattern_allow([^GREP$])
m4trace:configure.ac:34: -1- AC_SUBST([EGREP])
m4trace:configure.ac:34: -1- AC_SUBST_TRACE([EGREP])
m4trace:configure.ac:34: -1- m4_pattern_allow([^EGREP$])
m4trace:configure.ac:34: -1- AC_DEFINE_TRACE_LITERAL([STDC_HEADERS])
m4trace:configure.ac:34: -1- m4_pattern_allow([^STDC_HEADERS$])
m4trace:configure.ac:34: -1- AH_OUTPUT([STDC_HEADERS], [/* Define to 1 if you have the ANSI C header files. */
@%:@undef STDC_HEADERS])
m4trace:configure.ac:34: -1- AH_OUTPUT([HAVE_SYS_TYPES_H], [/* Define to 1 if you have the <sys/types.h> header file. */
@%:@undef HAVE_SYS_TYPES_H])
m4trace:configure.ac:34: -1- AH_OUTPUT([HAVE_SYS_STAT_H], [/* Define to 1 if you have the <sys/stat.h> header file. */
@%:@undef HAVE_SYS_STAT_H])
m4trace:configure.ac:34: -1- AH_OUTPUT([HAVE_STDLIB_H], [/* Define to 1 if you have the <stdlib.h> header file. */
@%:@undef HAVE_STDLIB_H])
m4trace:configure.ac:34: -1- AH_OUTPUT([HAVE_STRING_H], [/* Define to 1 if you have the <string.h> header file. */
@%:@undef HAVE_STRING_H])
m4trace:configure.ac:34: -1- AH_OUTPUT([HAVE_MEMORY_H], [/* Define to 1 if you have the <memory.h> header file. */
@%:@undef HAVE_MEMORY_H])
m4trace:configure.ac:34: -1- AH_OUTPUT([HAVE_STRINGS_H], [/* Define to 1 if you have the <strings.h> header file. */
@%:@undef HAVE_STRINGS_H])
m4trace:configure.ac:34: -1- AH_OUTPUT([HAVE_INTTYPES_H], [/* Define to 1 if you have the <inttypes.h> header file. */
@%:@undef HAVE_INTTYPES_H])
m4trace:configure.ac:34: -1- AH_OUTPUT([HAVE_STDINT_H], [/* Define to 1 if you have the <stdint.h> header file. */
@%:@undef HAVE_STDINT_H])
m4trace:configure.ac:34: -1- AH_OUTPUT([HAVE_UNISTD_H], [/* Define to 1 if you have the <unistd.h> header file. */
@%:@undef HAVE_UNISTD_H])
m4trace:configure.ac:34: -1- AC_DEFINE_TRACE_LITERAL([HAVE_NET_SNMP_NET_SNMP_CONFIG_H])
m4trace:configure.ac:34: -1- m4_pattern_allow([^HAVE_NET_SNMP_NET_SNMP_CONFIG_H$])
m4trace:configure.ac:36: -1- AH_OUTPUT([HAVE_LIBNETSNMP], [/* Define to 1 if you have the `netsnmp\' library (-lnetsnmp). */
@%:@undef HAVE_LIBNETSNMP])
m4trace:configure.ac:36: -1- AC_DEFINE_TRACE_LITERAL([HAVE_LIBNETSNMP])
m4trace:configure.ac:36: -1- m4_pattern_allow([^HAVE_LIBNETSNMP$])
m4trace:configure.ac:50: -2- AC_DEFINE_TRACE_LITERAL([HAVE_POW])
m4trace:configure.ac:50: -2- m4_pattern_allow([^HAVE_POW$])
m4trace:configure.ac:53: -2- AC_DEFINE_TRACE_LITERAL([HAVE_GETADDRINFO])
m4trace:configure.ac:53: -2- m4_pattern_allow([^HAVE_GETADDRINFO$])
m4trace:configure.ac:56: -1- AC_SUBST([SNMP_LIBS])
m4trace:configure.ac:56: -1- AC_SUBST_TRACE([SNMP_LIBS])
m4trace:configure.ac:56: -1- m4_pattern_allow([^SNMP_LIBS$])
m4trace:configure.ac:57: -1- AC_CONFIG_FILES([Makefile])
m4trace:configure.ac:58: -1- AC_SUBST([LIB@&t@OBJS], [$ac_libobjs])
m4trace:configure.ac:58: -1- AC_SUBST_TRACE([LIB@&t@OBJS])
m4trace:configure.ac:58: -1- m4_pattern_allow([^LIB@&t@OBJS$])
m4trace:configure.ac:58: -1- AC_SUBST([LTLIBOBJS], [$ac_ltlibobjs])
m4trace:configure.ac:58: -1- AC_SUBST_TRACE([LTLIBOBJS])
m4trace:configure.ac:58: -1- m4_pattern_allow([^LTLIBOBJS$])
m4trace:configure.ac:58: -1- AC_SUBST_TRACE([top_builddir])
m4trace:configure.ac:58: -1- AC_SUBST_TRACE([top_build_prefix])
m4trace:configure.ac:58: -1- AC_SUBST_TRACE([srcdir])
m4trace:configure.ac:58: -1- AC_SUBST_TRACE([abs_srcdir])
m4trace:configure.ac:58: -1- AC_SUBST_TRACE([top_srcdir])
m4trace:configure.ac:58: -1- AC_SUBST_TRACE([abs_top_srcdir])
m4trace:configure.ac:58: -1- AC_SUBST_TRACE([builddir])
m4trace:configure.ac:58: -1- AC_SUBST_TRACE([abs_builddir])
m4trace:configure.ac:58: -1- AC_SUBST_TRACE([abs_top_builddir])
m4trace:configure.ac:58: -1- AC_SUBST_TRACE([INSTALL])

4759
check_interfaces/check_interfaces-1.4/configure vendored Executable file

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,58 @@
AC_INIT(check_interfaces, 1.4)
AC_PREFIX_DEFAULT(/usr/local/nagios)
AC_PROG_CC
AC_PROG_INSTALL
if test "$cross_compiling" != "yes";
then
dnl look for net-snmp-config
AC_PATH_PROG(NETSNMPCONFIG, net-snmp-config)
if test "$ac_cv_path_netsnmpconfig" == "no";
then
AC_MSG_WARN([could not find net-snmp-config - did you install the development package for net-snmp? ])
else
SNMP_CFLAGS=`$NETSNMPCONFIG --cflags`
SNMP_LIBS=`$NETSNMPCONFIG --libs`
CFLAGS="$CFLAGS $SNMP_CFLAGS"
fi
fi
AC_ARG_WITH(snmp-headers,
AS_HELP_STRING([--with-snmp-headers=DIR], [Net-SNMP Include files location]),
[SNMP_HDR_DIR="$withval"]
[CPPFLAGS="$CPPFLAGS -I$withval"])
dnl if specified override SNMP_LIBS
AC_ARG_WITH(snmp-libs,
AS_HELP_STRING([--with-snmp-libs=DIR], [Net-SNMP Shared Library files location]),
[SNMP_LIBS="-lnetsnmp"]
[CFLAGS="$CFLAGS -L$withval"])
AC_CHECK_HEADERS([net-snmp/net-snmp-config.h])
AC_CHECK_LIB(netsnmp, snmp_open)
if test "$ac_cv_header_net_snmp_net_snmp_config_h" != "yes";
then
AC_MSG_ERROR([Net-SNMP Headers Missing])
fi
if test "$ac_cv_lib_netsnmp_snmp_open" != "yes";
then
AC_MSG_ERROR([Net-SNMP library unusable - either it is missing or there are unfulfilled dependencies (e.g. libcrypto)])
fi
dnl look for the pow() function
AC_SEARCH_LIBS(pow, [c m], AC_DEFINE([HAVE_POW]))
dnl look for the getaddrinfo() function
AC_SEARCH_LIBS(getaddrinfo, [c], AC_DEFINE([HAVE_GETADDRINFO]))
AC_SUBST([SNMP_LIBS])
AC_CONFIG_FILES([Makefile])
AC_OUTPUT

View file

@ -0,0 +1,507 @@
#!/bin/sh
# install - install a program, script, or datafile
scriptversion=2006-10-14.15
# This originates from X11R5 (mit/util/scripts/install.sh), which was
# later released in X11R6 (xc/config/util/install.sh) with the
# following copyright and license.
#
# Copyright (C) 1994 X Consortium
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to
# deal in the Software without restriction, including without limitation the
# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
# sell copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
# AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC-
# TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#
# Except as contained in this notice, the name of the X Consortium shall not
# be used in advertising or otherwise to promote the sale, use or other deal-
# ings in this Software without prior written authorization from the X Consor-
# tium.
#
#
# FSF changes to this file are in the public domain.
#
# Calling this script install-sh is preferred over install.sh, to prevent
# `make' implicit rules from creating a file called install from it
# when there is no Makefile.
#
# This script is compatible with the BSD install script, but was written
# from scratch.
nl='
'
IFS=" "" $nl"
# set DOITPROG to echo to test this script
# Don't use :- since 4.3BSD and earlier shells don't like it.
doit="${DOITPROG-}"
if test -z "$doit"; then
doit_exec=exec
else
doit_exec=$doit
fi
# Put in absolute file names if you don't have them in your path;
# or use environment vars.
mvprog="${MVPROG-mv}"
cpprog="${CPPROG-cp}"
chmodprog="${CHMODPROG-chmod}"
chownprog="${CHOWNPROG-chown}"
chgrpprog="${CHGRPPROG-chgrp}"
stripprog="${STRIPPROG-strip}"
rmprog="${RMPROG-rm}"
mkdirprog="${MKDIRPROG-mkdir}"
posix_glob=
posix_mkdir=
# Desired mode of installed file.
mode=0755
chmodcmd=$chmodprog
chowncmd=
chgrpcmd=
stripcmd=
rmcmd="$rmprog -f"
mvcmd="$mvprog"
src=
dst=
dir_arg=
dstarg=
no_target_directory=
usage="Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE
or: $0 [OPTION]... SRCFILES... DIRECTORY
or: $0 [OPTION]... -t DIRECTORY SRCFILES...
or: $0 [OPTION]... -d DIRECTORIES...
In the 1st form, copy SRCFILE to DSTFILE.
In the 2nd and 3rd, copy all SRCFILES to DIRECTORY.
In the 4th, create DIRECTORIES.
Options:
-c (ignored)
-d create directories instead of installing files.
-g GROUP $chgrpprog installed files to GROUP.
-m MODE $chmodprog installed files to MODE.
-o USER $chownprog installed files to USER.
-s $stripprog installed files.
-t DIRECTORY install into DIRECTORY.
-T report an error if DSTFILE is a directory.
--help display this help and exit.
--version display version info and exit.
Environment variables override the default commands:
CHGRPPROG CHMODPROG CHOWNPROG CPPROG MKDIRPROG MVPROG RMPROG STRIPPROG
"
while test $# -ne 0; do
case $1 in
-c) shift
continue;;
-d) dir_arg=true
shift
continue;;
-g) chgrpcmd="$chgrpprog $2"
shift
shift
continue;;
--help) echo "$usage"; exit $?;;
-m) mode=$2
shift
shift
case $mode in
*' '* | *' '* | *'
'* | *'*'* | *'?'* | *'['*)
echo "$0: invalid mode: $mode" >&2
exit 1;;
esac
continue;;
-o) chowncmd="$chownprog $2"
shift
shift
continue;;
-s) stripcmd=$stripprog
shift
continue;;
-t) dstarg=$2
shift
shift
continue;;
-T) no_target_directory=true
shift
continue;;
--version) echo "$0 $scriptversion"; exit $?;;
--) shift
break;;
-*) echo "$0: invalid option: $1" >&2
exit 1;;
*) break;;
esac
done
if test $# -ne 0 && test -z "$dir_arg$dstarg"; then
# When -d is used, all remaining arguments are directories to create.
# When -t is used, the destination is already specified.
# Otherwise, the last argument is the destination. Remove it from $@.
for arg
do
if test -n "$dstarg"; then
# $@ is not empty: it contains at least $arg.
set fnord "$@" "$dstarg"
shift # fnord
fi
shift # arg
dstarg=$arg
done
fi
if test $# -eq 0; then
if test -z "$dir_arg"; then
echo "$0: no input file specified." >&2
exit 1
fi
# It's OK to call `install-sh -d' without argument.
# This can happen when creating conditional directories.
exit 0
fi
if test -z "$dir_arg"; then
trap '(exit $?); exit' 1 2 13 15
# Set umask so as not to create temps with too-generous modes.
# However, 'strip' requires both read and write access to temps.
case $mode in
# Optimize common cases.
*644) cp_umask=133;;
*755) cp_umask=22;;
*[0-7])
if test -z "$stripcmd"; then
u_plus_rw=
else
u_plus_rw='% 200'
fi
cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;;
*)
if test -z "$stripcmd"; then
u_plus_rw=
else
u_plus_rw=,u+rw
fi
cp_umask=$mode$u_plus_rw;;
esac
fi
for src
do
# Protect names starting with `-'.
case $src in
-*) src=./$src ;;
esac
if test -n "$dir_arg"; then
dst=$src
dstdir=$dst
test -d "$dstdir"
dstdir_status=$?
else
# Waiting for this to be detected by the "$cpprog $src $dsttmp" command
# might cause directories to be created, which would be especially bad
# if $src (and thus $dsttmp) contains '*'.
if test ! -f "$src" && test ! -d "$src"; then
echo "$0: $src does not exist." >&2
exit 1
fi
if test -z "$dstarg"; then
echo "$0: no destination specified." >&2
exit 1
fi
dst=$dstarg
# Protect names starting with `-'.
case $dst in
-*) dst=./$dst ;;
esac
# If destination is a directory, append the input filename; won't work
# if double slashes aren't ignored.
if test -d "$dst"; then
if test -n "$no_target_directory"; then
echo "$0: $dstarg: Is a directory" >&2
exit 1
fi
dstdir=$dst
dst=$dstdir/`basename "$src"`
dstdir_status=0
else
# Prefer dirname, but fall back on a substitute if dirname fails.
dstdir=`
(dirname "$dst") 2>/dev/null ||
expr X"$dst" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
X"$dst" : 'X\(//\)[^/]' \| \
X"$dst" : 'X\(//\)$' \| \
X"$dst" : 'X\(/\)' \| . 2>/dev/null ||
echo X"$dst" |
sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
s//\1/
q
}
/^X\(\/\/\)[^/].*/{
s//\1/
q
}
/^X\(\/\/\)$/{
s//\1/
q
}
/^X\(\/\).*/{
s//\1/
q
}
s/.*/./; q'
`
test -d "$dstdir"
dstdir_status=$?
fi
fi
obsolete_mkdir_used=false
if test $dstdir_status != 0; then
case $posix_mkdir in
'')
# Create intermediate dirs using mode 755 as modified by the umask.
# This is like FreeBSD 'install' as of 1997-10-28.
umask=`umask`
case $stripcmd.$umask in
# Optimize common cases.
*[2367][2367]) mkdir_umask=$umask;;
.*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;;
*[0-7])
mkdir_umask=`expr $umask + 22 \
- $umask % 100 % 40 + $umask % 20 \
- $umask % 10 % 4 + $umask % 2
`;;
*) mkdir_umask=$umask,go-w;;
esac
# With -d, create the new directory with the user-specified mode.
# Otherwise, rely on $mkdir_umask.
if test -n "$dir_arg"; then
mkdir_mode=-m$mode
else
mkdir_mode=
fi
posix_mkdir=false
case $umask in
*[123567][0-7][0-7])
# POSIX mkdir -p sets u+wx bits regardless of umask, which
# is incompatible with FreeBSD 'install' when (umask & 300) != 0.
;;
*)
tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$
trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0
if (umask $mkdir_umask &&
exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/dev/null 2>&1
then
if test -z "$dir_arg" || {
# Check for POSIX incompatibilities with -m.
# HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or
# other-writeable bit of parent directory when it shouldn't.
# FreeBSD 6.1 mkdir -m -p sets mode of existing directory.
ls_ld_tmpdir=`ls -ld "$tmpdir"`
case $ls_ld_tmpdir in
d????-?r-*) different_mode=700;;
d????-?--*) different_mode=755;;
*) false;;
esac &&
$mkdirprog -m$different_mode -p -- "$tmpdir" && {
ls_ld_tmpdir_1=`ls -ld "$tmpdir"`
test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1"
}
}
then posix_mkdir=:
fi
rmdir "$tmpdir/d" "$tmpdir"
else
# Remove any dirs left behind by ancient mkdir implementations.
rmdir ./$mkdir_mode ./-p ./-- 2>/dev/null
fi
trap '' 0;;
esac;;
esac
if
$posix_mkdir && (
umask $mkdir_umask &&
$doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir"
)
then :
else
# The umask is ridiculous, or mkdir does not conform to POSIX,
# or it failed possibly due to a race condition. Create the
# directory the slow way, step by step, checking for races as we go.
case $dstdir in
/*) prefix=/ ;;
-*) prefix=./ ;;
*) prefix= ;;
esac
case $posix_glob in
'')
if (set -f) 2>/dev/null; then
posix_glob=true
else
posix_glob=false
fi ;;
esac
oIFS=$IFS
IFS=/
$posix_glob && set -f
set fnord $dstdir
shift
$posix_glob && set +f
IFS=$oIFS
prefixes=
for d
do
test -z "$d" && continue
prefix=$prefix$d
if test -d "$prefix"; then
prefixes=
else
if $posix_mkdir; then
(umask=$mkdir_umask &&
$doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break
# Don't fail if two instances are running concurrently.
test -d "$prefix" || exit 1
else
case $prefix in
*\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;;
*) qprefix=$prefix;;
esac
prefixes="$prefixes '$qprefix'"
fi
fi
prefix=$prefix/
done
if test -n "$prefixes"; then
# Don't fail if two instances are running concurrently.
(umask $mkdir_umask &&
eval "\$doit_exec \$mkdirprog $prefixes") ||
test -d "$dstdir" || exit 1
obsolete_mkdir_used=true
fi
fi
fi
if test -n "$dir_arg"; then
{ test -z "$chowncmd" || $doit $chowncmd "$dst"; } &&
{ test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } &&
{ test "$obsolete_mkdir_used$chowncmd$chgrpcmd" = false ||
test -z "$chmodcmd" || $doit $chmodcmd $mode "$dst"; } || exit 1
else
# Make a couple of temp file names in the proper directory.
dsttmp=$dstdir/_inst.$$_
rmtmp=$dstdir/_rm.$$_
# Trap to clean up those temp files at exit.
trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0
# Copy the file name to the temp name.
(umask $cp_umask && $doit_exec $cpprog "$src" "$dsttmp") &&
# and set any options; do chmod last to preserve setuid bits.
#
# If any of these fail, we abort the whole thing. If we want to
# ignore errors from any of these, just make sure not to ignore
# errors from the above "$doit $cpprog $src $dsttmp" command.
#
{ test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } \
&& { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } \
&& { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } \
&& { test -z "$chmodcmd" || $doit $chmodcmd $mode "$dsttmp"; } &&
# Now rename the file to the real destination.
{ $doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null \
|| {
# The rename failed, perhaps because mv can't rename something else
# to itself, or perhaps because mv is so ancient that it does not
# support -f.
# Now remove or move aside any old file at destination location.
# We try this two ways since rm can't unlink itself on some
# systems and the destination file might be busy for other
# reasons. In this case, the final cleanup might fail but the new
# file should still install successfully.
{
if test -f "$dst"; then
$doit $rmcmd -f "$dst" 2>/dev/null \
|| { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null \
&& { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; }; }\
|| {
echo "$0: cannot unlink or rename $dst" >&2
(exit 1); exit 1
}
else
:
fi
} &&
# Now rename the file to the real destination.
$doit $mvcmd "$dsttmp" "$dst"
}
} || exit 1
trap '' 0
fi
done
# Local variables:
# eval: (add-hook 'write-file-hooks 'time-stamp)
# time-stamp-start: "scriptversion="
# time-stamp-format: "%:y-%02m-%02d.%02H"
# time-stamp-end: "$"
# End:

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,182 @@
#include <limits.h>
#ifdef HAVE_GETADDRINFO
#include <sys/types.h>
#include <sys/socket.h>
#include <netdb.h>
#endif /* HAVE_GETADDRINFO */
#include <net-snmp/net-snmp-config.h>
#include <net-snmp/net-snmp-includes.h>
/*
* defines
* MAX_STRING = allocate memory for this length of output string
*/
#define MAX_STRING 65536
#define MAX_DESCR_LEN 60
#define UPTIME_TOLERANCE_IN_SECS 30
#define OFLO32 4294967295ULL
#define OFLO64 18446744073709551615ULL
/* default timeout is 30s */
#define DFLT_TIMEOUT 30000000UL
/* should a timeout return critical(2) or unknown(3)? */
#define EXITCODE_TIMEOUT 3
#define MEMCPY(a, b, c) memcpy(a, b, (sizeof(a)>c)?c:sizeof(a))
#define TERMSTR(a, b) a[(((sizeof(a)-1)<b)?(sizeof(a)-1):b)] = '\0'
#ifndef U64
#define U64
typedef unsigned long long u64;
#endif
/*
* structs
*/
struct ifStruct {
int ignore;
int admin_down;
int print_all_flag;
int index;
int status;
int err_disable;
char descr[MAX_DESCR_LEN];
char alias[MAX_DESCR_LEN];
char name[MAX_DESCR_LEN];
u64 inOctets;
u64 outOctets;
unsigned long inDiscards;
unsigned long outDiscards;
unsigned long inErrors;
unsigned long outErrors;
unsigned long inUcast;
unsigned long outUcast;
u64 speed;
};
struct OIDStruct {
oid name[MAX_OID_LEN];
size_t name_len;
};
/*
* text strings to output in the perfdata
*/
static char *if_vars_default[] = {
"inOctets",
"outOctets",
"inDiscards",
"outDiscards",
"inErrors",
"outErrors",
"inUcast",
"outUcast",
"speed" };
static char *if_vars_cisco[] = {
"inOctets",
"outOctets",
"inDiscards",
"outDiscards",
"inCRCs",
"outCollisions",
"inUcast",
"outUcast",
"speed" };
/*
* OIDs, hardcoded to remove the dependency on MIBs
*/
static char *oid_if_bulkget[] = {".1.3.6.1.2.1.1.3", ".1.3.6.1.2.1.2.1", ".1.3.6.1.2.1.2.2.1.2", 0}; /* "uptime", "ifNumber", "ifDescr" */
static char *oid_if_get[] = {".1.3.6.1.2.1.1.3.0", ".1.3.6.1.2.1.2.1.0", ".1.3.6.1.2.1.2.2.1.2.1", 0}; /* "uptime", "ifNumber", "ifDescr" */
static char *oid_if_bintec[] = {".1.3.6.1.2.1.1.3.0", ".1.3.6.1.2.1.2.1.0", ".1.3.6.1.2.1.2.2.1.2.0", 0}; /* "uptime", "ifNumber", "ifDescr" */
static char *oid_alias_bulkget[] = {".1.3.6.1.2.1.31.1.1.1.18", 0}; /* "alias" */
static char *oid_alias_get[] = {".1.3.6.1.2.1.31.1.1.1.18.1", 0}; /* "alias" */
static char *oid_alias_bintec[] = {".1.3.6.1.2.1.31.1.1.1.18.0", 0}; /* "alias" */
static char *oid_vals_default[] = {
".1.3.6.1.2.1.2.2.1.7", /* ifAdminStatus */
".1.3.6.1.2.1.2.2.1.8", /* ifOperStatus */
".1.3.6.1.2.1.2.2.1.10", /* ifInOctets */
".1.3.6.1.2.1.2.2.1.13", /* ifInDiscards */
".1.3.6.1.2.1.2.2.1.14", /* ifInErrors */
".1.3.6.1.2.1.2.2.1.16", /* ifOutOctets */
".1.3.6.1.2.1.2.2.1.19", /* ifOutDiscards */
".1.3.6.1.2.1.2.2.1.20", /* ifOutErrors */
0
};
static char *oid_vals_cisco[] = {
".1.3.6.1.2.1.2.2.1.7", /* ifAdminStatus */
".1.3.6.1.2.1.2.2.1.8", /* ifOperStatus */
".1.3.6.1.2.1.2.2.1.10", /* ifInOctets */
".1.3.6.1.2.1.2.2.1.13", /* ifInDiscards */
".1.3.6.1.4.1.9.2.2.1.1.12", /* locIfInCRC */
".1.3.6.1.2.1.2.2.1.16", /* ifOutOctets */
".1.3.6.1.2.1.2.2.1.19", /* ifOutDiscards */
".1.3.6.1.4.1.9.2.2.1.1.25", /* locIfCollisions */
0
};
static char *oid_extended[] = {
".1.3.6.1.2.1.31.1.1.1.6", /* ifHCInOctets */
".1.3.6.1.2.1.31.1.1.1.10",/* ifHCOutOctets */
".1.3.6.1.2.1.2.2.1.11", /* ifInUcastPkts */
".1.3.6.1.2.1.2.2.1.17", /* ifOutUcastPkts */
".1.3.6.1.2.1.2.2.1.5", /* ifSpeed */
".1.3.6.1.2.1.31.1.1.1.15",/* ifHighSpeed */
".1.3.6.1.2.1.31.1.1.1.18",/* alias */
".1.3.6.1.2.1.31.1.1.1.1", /* name */
0
};
static char *oid_extended_cisco[] = {
".1.3.6.1.4.1.9.5.1.4.1.1.23", /* portAdditionalOperStatus */
0
};
static char default_community[] = "public";
/*
* operating modes
*/
const char *modes[] = { "default", "cisco", "nonbulk", "bintec", NULL };
enum mode_enum { DEFAULT, CISCO, NONBULK, BINTEC };
/*
* prototypes
*/
void print64(struct counter64*, unsigned long*);
u64 convertto64(struct counter64 *, unsigned long *);
u64 subtract64(u64, u64);
netsnmp_session *start_session(netsnmp_session *, char *, char *);
netsnmp_session *start_session_v3(netsnmp_session *, char *, char *, char *, char *, char *, char *);
int usage(char *);
int parse_perfdata(char *, struct ifStruct *, char *);
void set_value(struct ifStruct *, char *, char *, u64, char *);
int parseoids(int, char *, struct OIDStruct *);
int create_request(netsnmp_session *, struct OIDStruct **, char **, int, netsnmp_pdu **);

View file

@ -0,0 +1,202 @@
#include <stdarg.h>
#include <stddef.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
#include "utils.h"
/*
* Add a string
*/
int addstrold(char **strp, size_t *strs, const char *format, ...)
{
va_list val;
size_t written;
va_start(val, format);
written = vsnprintf(*strp, *strs, format, val);
va_end(val);
if (written >= *strs)
{
// buffer full
*strs = 0;
return(1);
}
*strs = (*strs - written);
*strp = (*strp + written);
return(0);
}
int addstr(String *str, const char *format, ...)
{
va_list val;
size_t written;
size_t available;
char *pos;
available = str->max - str->len;
pos = str->text + str->len;
va_start(val, format);
written = vsnprintf(pos, available, format, val);
va_end(val);
if (written >= available)
{
/* buffer full */
str->text[(str->max)] = 0;
str->len = str->max;
return(1);
}
str->len = str->len + written;
return(0);
}
/*
* Replace troublesome characters in a string with underscores
* - only use for strings we already know the size of */
void strcpy_nospaces(char *dest, char *src)
{
static unsigned char allowed[256] = "_________________________________!_#_%__()*+,-.-0123456789_____?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[_]^__abcdefghijklmnopqrstuvwxyz{_}__________________________________________________________________________________________________________________________________";
while(*src)
{
*(dest++) = allowed[(unsigned char) *(src++)];
}
*dest = 0;
}
/*
* convert a (possibly large) integer to a string with unit suffix
*
* add the following check to configure.ac
* AC_SEARCH_LIBS(pow, [c m], AC_DEFINE([HAVE_POW]))
*/
int gauge_to_si(u64 bignum, char **str)
{
int i = 0;
u64 tmpll;
static char units[] = "kMGTPE";
tmpll = bignum;
while ((tmpll /= 1000ULL) && (i < (sizeof(units) - 1)))
{
i++;
}
#ifdef HAVE_POW
if (i)
{
return asprintf(str, "%0.2f%c", ((double)bignum / pow(1000, i)), units[i-1]);
}
else
{
return asprintf(str, "%Ld", bignum);
}
#else
return asprintf(str, "%Ld", bignum);
#endif
}
static
struct timespec benchmark_start_time;
static
char *benchmark_task;
void benchmark_start(char const *format, ...)
{
{
va_list args;
va_start(args, format);
int benchmark_task_length = vsnprintf(NULL, 0u, format, args);
va_end(args);
benchmark_task = (char*)malloc(benchmark_task_length + 1);
benchmark_task[benchmark_task_length] = 0;
}
{
va_list args;
va_start(args, format);
vsprintf(benchmark_task, format, args);
va_end(args);
}
fprintf(stderr, "[Starting benchmark] %s\n", benchmark_task);
clock_gettime(CLOCK_MONOTONIC, &benchmark_start_time);
}
void benchmark_end(void)
{
{
struct timespec benchmark_end_time;
clock_gettime(CLOCK_MONOTONIC, &benchmark_end_time);
fprintf(
stderr,
"[Finished benchmark after %f ms] %s\n",
((double)benchmark_end_time.tv_sec * 1000.0 + (double)benchmark_end_time.tv_nsec / 1000000.0)
- ((double)benchmark_start_time.tv_sec * 1000.0 + (double)benchmark_start_time.tv_nsec / 1000000.0),
benchmark_task
);
}
free(benchmark_task);
}
char *implode(char const *glue, char **pieces)
{
size_t total_len = 0u;
char **walk_pieces = pieces;
while (*walk_pieces != NULL) {
total_len += strlen(*walk_pieces++);
}
ptrdiff_t walk_pieces_diff = walk_pieces - pieces;
if (walk_pieces_diff >= 2) {
total_len += strlen(glue) * (size_t)(walk_pieces_diff - 1);
}
char *result = (char*)malloc(total_len + 1u);
if (walk_pieces_diff > 0) {
strcpy(result, *pieces);
if (walk_pieces_diff >= 2) {
char *walk_result = result;
walk_pieces = pieces + 1;
while (*walk_pieces != NULL) {
while (*walk_result) {
++walk_result;
}
strcpy(walk_result, glue);
while (*walk_result) {
++walk_result;
}
strcpy(walk_result, *walk_pieces++);
}
}
} else {
*result = 0;
}
return result;
}

View file

@ -0,0 +1,33 @@
/* asprintf */
#ifndef _GNU_SOURCE
#define _GNU_SOURCE
#endif
#include <stdio.h>
#include <stdarg.h>
#ifdef HAVE_POW
#include <math.h>
#endif
#ifndef U64
#define U64
typedef unsigned long long u64;
#endif
struct stringStruct {
size_t max;
size_t len;
char * text; /* pointer to an allocation of max + 1 */
};
typedef struct stringStruct String;
int addstrold(char **, size_t *, const char *, ...);
int addstr(String *, const char *, ...);
void strcpy_nospaces(char *, char *);
int gauge_to_si(u64, char **);
void benchmark_start(char const *, ...);
void benchmark_end(void);
char *implode(char const *, char **);

5
check_interfaces/control Normal file
View file

@ -0,0 +1,5 @@
Homepage: https://github.com/NETWAYS/check_interfaces
Uploaders: Jan Wagner <waja@cyconet.org>
Description: This plugin uses the bulk-get mode of SNMPv2 by default
Build-Depends: autotools-dev, libsnmp-dev
Version: 1.4

View file

@ -0,0 +1,19 @@
AUTHOR: NETWAYS GmbH, William Preston <support@netways.de>
License: GPL v2
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, 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.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
On Debian systems, the complete text of the GNU General
Public License version 2 can be found in "/usr/share/common-licenses/GPL-2".

1
check_interfaces/src Symbolic link
View file

@ -0,0 +1 @@
check_interfaces-1.4/

7
debian/control vendored
View file

@ -9,7 +9,7 @@ Build-Depends: autotools-dev,
python3,
python3-debian,
quilt (>= 0.46-7),
autotools-dev
autotools-dev, libsnmp-dev
Standards-Version: 3.9.6
Vcs-Git: git://github.com/waja/monitoring-plugins-cyconet
Vcs-Browser: http://github.com/waja/monitoring-plugins-cyconet
@ -17,7 +17,7 @@ Vcs-Browser: http://github.com/waja/monitoring-plugins-cyconet
Package: monitoring-plugins-cyconet
Architecture: any
Depends: ${misc:Depends}
Recommends: libdata-dump-perl, libweb-scraper-perl, libmonitoring-plugin-perl | libnagios-plugin-perl, libnet-snmp-perl, monitoring-plugins-common | nagios-plugins-common, libtime-modules-perl, sysstat, bc, fping, strongswan-starter | openswan, libdbd-mysql-perl, python3-minimal, libwww-perl, libpython-stdlib, libio-socket-ssl-perl, snmp, gawk | mawk, libredis-perl, ruby-redis, libio-socket-inet6-perl, libmonitoring-plugin-perl | libmonitoring-plugin-perl, perl-modules, libnet-tftp-perl, libxml-xpath-perl,
Recommends: libdata-dump-perl, libweb-scraper-perl, libmonitoring-plugin-perl | libnagios-plugin-perl, libnet-snmp-perl, monitoring-plugins-common | nagios-plugins-common, libtime-modules-perl, libsnmp-perl, libnet-dns-perl, sysstat, bc, fping, strongswan-starter | openswan, libdbd-mysql-perl, python3-minimal, libwww-perl, libpython-stdlib, libio-socket-ssl-perl, gawk | mawk, snmp, libredis-perl, ruby-redis, libio-socket-inet6-perl, libmonitoring-plugin-perl | libmonitoring-plugin-perl, perl-modules, libnet-tftp-perl, libxml-xpath-perl,
${perl:Depends},
${python:Depends},
${shlibs:Depends}
@ -31,6 +31,8 @@ Description: Plugins for nagios compatible monitoring systems
* check_apache_balancer_members (8e1ad17): plugin to monitor Apache2 balancer_manager
* check_bgp (0.4): plugin to check BGP peer status via SNMP.
* check_file: plugin to check file count, size and ages
* check_iftraffic64 (.77): plugin for checking network traffic by snmp.
* check_interfaces (1.4): This plugin uses the bulk-get mode of SNMPv2 by default
* check_iostat (0.0.9): plugin shows the I/O usage of the specified disk.
* check_iostats (0.1): plugin shows the I/O usage of the specified disk, perl implementation.
* check_ipsec (2.0): plugin checking ipsec connections from open- or stongswan
@ -43,7 +45,6 @@ Description: Plugins for nagios compatible monitoring systems
of network components like switches and routers.
* check_openvpn (20160803): plugin to check if an OpenVPN server runs on a given port
* check_phpfpm_status (1.1): plugin to check the fpm-status page report from php-fpm
* check_qnap3 (1.23.3): plugin to check NAS QNAP.
* check_qnap_health (1.00): plugin to check NAS QNAP.
* check_redis (0.72): plugin that verifies redis server is working.
* check_sentinel (0b8e0e3): plugin to monitor Redis sentinel

60
debian/copyright vendored
View file

@ -105,6 +105,50 @@ check_file:
------------------------------------------------------------------------------
check_iftraffic64:
The plugin was downloaded from:
https://exchange.nagios.org/directory/Plugins/Network-Connections%2C-Stats-and-Bandwidth/check_iftraffic64/details
Copyright (C) 2004 Gerd Mueller / Netways GmbH
License: GPL+
On Debian systems, the complete text of the GNU General
Public License can be found in "/usr/share/common-licenses/GPL".
------------------------------------------------------------------------------
check_interfaces:
The plugin was downloaded from:
https://github.com/NETWAYS/check_interfaces
AUTHOR: NETWAYS GmbH, William Preston <support@netways.de>
License: GPL v2
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, 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.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
On Debian systems, the complete text of the GNU General
Public License version 2 can be found in "/usr/share/common-licenses/GPL-2".
------------------------------------------------------------------------------
check_iostat:
@ -274,22 +318,6 @@ https://raw.github.com/regilero/check_phpfpm_status/master/check_phpfpm_status.p
------------------------------------------------------------------------------
check_qnap3:
The plugin was downloaded from:
https://github.com/nikband/check_qnap3.sh
Copyright (c) 2008 Shahid Iqbal
License: GPL+
On Debian systems, the complete text of the GNU General
Public License can be found in "/usr/share/common-licenses/GPL".
------------------------------------------------------------------------------
check_qnap_health:

View file

@ -4,5 +4,6 @@ etc/monitoring-plugins/config etc/nagios-plugins/config/monitoring-plugins
usr/lib/monitoring-plugins/check_iostat usr/lib/nagios/plugins/check_iostat
usr/lib/monitoring-plugins/check_iostats usr/lib/nagios/plugins/check_iostats
usr/lib/monitoring-plugins/check_nwc_health usr/lib/nagios/plugins/check_nwc_health
usr/lib/monitoring-plugins/check_qnap3 usr/lib/nagios/plugins/check_qnap3
usr/lib/monitoring-plugins/check_qnap_health usr/lib/nagios/plugins/check_qnap_health
usr/lib/monitoring-plugins/check_iftraffic64 usr/lib/nagios/plugins/check_iftraffic64
usr/lib/monitoring-plugins/check_interfaces usr/lib/nagios/plugins/check_interfaces