Compare commits

..

No commits in common. "master" and "upstream" have entirely different histories.

45 changed files with 0 additions and 3481 deletions

View file

@ -1,12 +0,0 @@
version: 2
updates:
- package-ecosystem: github-actions
directory: "/"
schedule:
interval: daily
time: "04:00"
reviewers:
- "waja"
pull-request-branch-name:
separator: "-"
open-pull-requests-limit: 10

View file

@ -1,36 +0,0 @@
name: Packaging Test
on:
push:
branches:
- $default-branch
- development
- master
# Run tests for any PRs
pull_request:
env:
SOURCE_DIR: ./
ARTIFACTS_DIR: debian/build/release/
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
env:
DEBIAN_FRONTEND: "noninteractive"
- name: Remove github artefacts
run: |
rm -rf .github*
- name: Adjust distibution in changelog file
run: |
sed -i '0,/restricted/s//stable/' debian/changelog
- name: Build Debian package
uses: dawidd6/action-debian-package@v1.5.0
with:
artifacts_directory: debian/build/release/
os_distribution: testing
- name: Debug
run: |
ls -la

View file

@ -1,71 +0,0 @@
on:
push:
# Sequence of patterns matched against refs/tags
tags:
- 'debian/*' # Push events to matching debian/*, i.e. debian/1.0-2, debian/20.15.10, debian/23.20020326
name: Release Process
env:
SOURCE_DIR: ./
ARTIFACTS_DIR: debian/build/release/
jobs:
create-release:
name: Create Release
runs-on: ubuntu-latest
outputs:
release-id: ${{ steps.create_release.outputs.id }}
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Install needed packages
run: |
if [ $(dpkg -l | grep -c dpkg-dev) -ne 1 ]; then sudo apt-get update && sudo apt-get install -y dpkg-dev; fi
- name: Gather changelog
run: |
ls -la
dpkg-parsechangelog | tail -n +9 > debian.changelog
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ github.ref }}
body_path: debian.changelog
draft: false
prerelease: false
build:
name: Build and upload packages
needs: create-release
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
env:
DEBIAN_FRONTEND: "noninteractive"
- name: Remove github artefacts
run: |
rm -rf .github*
- name: Adjust distibution in changelog file
run: |
sed -i '0,/restricted/s//stable/' debian/changelog
- name: Build Debian package
uses: dawidd6/action-debian-package@v1.5.0
with:
artifacts_directory: debian/build/release/
os_distribution: testing
# - name: Build Debian package
# uses: pi-top/action-debian-package@v0.2.0
# with:
# artifacts_directory: debian/build/release/
# target_architectures: "amd64,i386"
- name: Upload the artifacts
uses: skx/github-action-publish-binaries@release-2.0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
releaseId: ${{ needs.create-release.outputs.release-id }}
args: debian/build/release/*

15
debian/.gitlab-ci.yml vendored
View file

@ -1,15 +0,0 @@
---
include:
- https://salsa.debian.org/salsa-ci-team/pipeline/raw/master/recipes/debian.yml
variables:
RELEASE: 'unstable'
SALSA_CI_DISABLE_APTLY: 0
SALSA_CI_DISABLE_AUTOPKGTEST: 0
SALSA_CI_DISABLE_BLHC: 0
SALSA_CI_DISABLE_LINTIAN: 0
SALSA_CI_DISABLE_PIUPARTS: 0
SALSA_CI_DISABLE_REPROTEST: 0
SALSA_CI_DISABLE_BUILD_PACKAGE_ALL: 0
SALSA_CI_DISABLE_BUILD_PACKAGE_ANY: 0
SALSA_CI_ENABLE_BUILD_PACKAGE_TWICE: 1

21
debian/NEWS vendored
View file

@ -1,21 +0,0 @@
nagios-snmp-plugins (1.1.1-8) unstable; urgency=low
The following plugins are using now '-p' to specify the port and '-P' the
protocol:
- check_snmp_load
- check_snmp_mem
- check_snmp_process
- check_snmp_storage
The port is specified with '-p' now and the protocol with '-P':
Network protocol to be used
['udp/ipv4'] : UDP over IPv4
'udp/ipv6' : UDP over IPv6
'tcp/ipv4' : TCP over IPv4
'tcp/ipv6' : TCP over IPv6
Network protocol (Default udp/ipv4)
-- Jan Wagner <waja@cyconet.org> Sun, 02 Mar 2014 23:45:13 +0100

260
debian/README.Debian vendored
View file

@ -1,260 +0,0 @@
nagios-snmp-plugins for Debian
------------------------------
If you are using snmp v1 and v2c, you can provide your community as last
argument with your check_command. So you can specify different communities
for different services. With snmp v3 you need to set $USER9$ like shown in
the config snipsets in your resource.cfg or you need to modify your
command definitions!
See http://www.manubulon.com/nagios/index_commands.html#snmplogin
and http://www.manubulon.com/nagios/index_info.html#snmplogin
These snipsets are dumped from nagios-snmp-plugins website.
Look at <http://www.manubulon.com/nagios/index_commands.html> and
<http://www.manubulon.com/nagios/index_info.html> for more (actual) info!
Here are commands example to use the scripts with nagios.
All these commands use $USER<n>$ macros to put snmp login. You
have to do this for these examples to work.
The $USER<n>$ macro are defined in the resources.cfg file
If you are using snmp v1 :
$USER7$=-C <community>
If you are using snmp v2c :
$USER7$=-C <community> -2
Examples of snmp v3 login :
AuthNoPriv (md5) :
$USER8$=-l <login> -x <pass>
AuthPriv (md5,aes) :
$USER8$=-l <login> -x <pass> -X <pass> -L md5,aes
About regular expressions
With all these scripts, when you select an interface, a service or process name
etc... you use by default regular expressions :
Note : you can disable this by using "-r"
Examples : Don't forget it is perl regular expressions.
Regexp Will match
eth eth0, eth1, eth2 but also Fastethernet0/0 ....
eth[1-9] eth1, eth2, ... eth9 but also eth10, eth11
eth[1-2]$ eth1, eth2 only (not eth11 for ex).
dhcp dhcpc, dhpcd
* check_snmp_cpfw.pl
define command {
command_name check_snmp_cpfw_v3
command_line /usr/lib/nagios/plugins/check_snmp_cpfw.pl -H $HOSTADDRESS$ $USER8$
$ARG1$
}
define service {
name checkpoint_verification
check_command check_snmp_cpfw_v3!-swa -p Solsoft_Policy \
-c 100000,200000 -f
}
* check_snmp_load.pl
define command {
command_name check_snmp_load_v1
command_line /usr/lib/nagios/plugins/check_snmp_load.pl -H $HOSTADDRESS$ $USER7$ -T
$ARG1$ -w $ARG2$ -c $ARG3$ $ARG4$
}
define command {
command_name check_snmp_load_v3
command_line /usr/lib/nagios/plugins/check_snmp_load.pl -H $HOSTADDRESS$ $USER8$ -T
$ARG1$ -w $ARG2$ -c $ARG3$ $ARG4$
}
define service {
name bluecoat_load
check_command check_snmp_load_v1!bc!95!99
}
define service {
name Linux_load
check_command check_snmp_load_v1!netsl!4,3,3!8,5,5
}
define service {
name Cisco_load
check_command check_snmp_load_v1!cisco!90,80,60!100,100,100
}
define service {
name lp_load
check_command check_snmp_load_v1!lp!90!99
}
* check_snmp_interface.pl
define command {
command_name check_snmp_int_v1
command_line /usr/lib/nagios/plugins/check_snmp_int.pl -H $HOSTADDRESS$ $USER7$ -n
$ARG1$ $ARG2$
}
define command{
command_name check_snmp_int_v3
command_line /usr/lib/nagios/plugins/check_snmp_int.pl -H $HOSTADDRESS$ $USER8$ -n
$ARG1$ $ARG2$
}
define service {
name check_int_1_6
check_command check_snmp_int_v1!"FastEthernet-[1-6]"
}
define service {
name check_int_eth0_bdw
check_command check_snmp_int_v3!eth0!-k -w 100,50 -c 0,0
}
* check_snmp_mem.pl
define command {
command_name check_snmp_mem_v1
command_line /usr/lib/nagios/plugins/check_snmp_mem.pl -H $HOSTADDRESS$ $USER7$ $ARG1$
-w $ARG2$ -c $ARG3$ $ARG4$
}
define command {
command_name check_snmp_mem_v3
command_line /usr/lib/nagios/plugins/check_snmp_mem.pl -H $HOSTADDRESS$ $USER8$ $ARG1$
-w $ARG2$ -c $ARG3$ $ARG4$
}
define service {
name Linux_memory
check_command check_snmp_mem_v1!-N!95,60!99,90
}
define service {
name Cisco_mem
check_command check_snmp_mem_v1!-I!80!99
}
* check_snmp_process.pl
define command {
command_name check_snmp_process_v1
command_line /usr/lib/nagios/plugins/check_snmp_process.pl -H $HOSTADDRESS$ $USER7$ -n
$ARG1$ -w $ARG2$ -c $ARG3$ $ARG4$
}
define service {
name proxy_checks
check_command check_snmp_process_v1!proxy!21,1999!20,2000!-2
}
define service {
name Check_httpd_all
check_command check_snmp_process_v1!httpd!5,100!0!-2 -m 20,30 -u 90,99
}
define service {
name check_crontab
service_description Check Crontab service
check_command check_snmp_process!crond!0!0
}
* check_snmp_storage.pl
define command {
command_name check_snmp_storage_v1
command_line /usr/lib/nagios/plugins/check_snmp_storage.pl -H $HOSTADDRESS$ $USER7$ -m
$ARG1$ -w $ARG2$ -c $ARG3$ $ARG4$
}
define command {
command_name check_snmp_storage_v3
command_line /usr/lib/nagios/plugins/check_snmp_storage.pl -H $HOSTADDRESS$ $USER8$ -m
$ARG1$ -w $ARG2$ -c $ARG3$ $ARG4$
}
define service {
name Check_LinDisk_home
service_description Check /home
check_command check_snmp_storage_v3!/home!90!97!-r
}
define service {
name Win_check_swap
service_description Check Windows swap
check_command check_snmp_storage_v3!Virtual!60!90
}
define service {
name check_linux_swap
service_description Check swap linux
check_command check_snmp_storage_v1!Swap!60!90!
}
define service {
name check_disk_all
service_description Check / /opt /var /config
check_command check_snmp_storage_v1!"^/$|opt|config|var"!80!90!
}
* check_snmp_vrrp.pl
define command {
command_name check_snmp_vrrp_v1
command_line /usr/lib/nagios/plugins/check_snmp_vrrp.pl -H $HOSTADDRESS$ $USER7$ -T
$ARG1$ -s $ARG2$
}
define command {
command_name check_snmp_vrrp_v3
command_line /usr/lib/nagios/plugins/check_snmp_vrrp.pl -H $HOSTADDRESS$ $USER8$ -T
$ARG1$ -s $ARG2$
}
define service {
name Linkproof_check_vrrp_master
service_description Check vrrp in master state
check_command check_snmp_vrrp_v3!lp!master
}
define service {
name Linkproof_check_vrrp_backup
service_description Check vrrp in backup state
check_command check_snmp_vrrp_v3!lp!backup
}
define service {
name Nokia_clustering
check_command check_snmp_vrrp_v3!ipso!2,98%
}
* check_snmp_win.pl
define command {
command_name check_win
command_line /usr/lib/nagios/plugins/check_snmp_win.pl -H $HOSTADDRESS$ $USER7$ -n
$ARG2$
# comment community service(s) name
}
define service {
name check_win_dhcp
service_description Check dhcp service
check_command check_win!dhcp
register 0
}
define service {
name check_win_reg_spool
service_description Verification acces au registre en spooleur
check_command check_win!"au registre",spouleur
register 0
}
-- Jan Wagner <waja@cyconet.org> Fri, 26 Jan 2007 16:32:47 +0100

View file

@ -1,3 +0,0 @@
We use dpatch for patch handling inside our package(s). Please see
/usr/share/doc/dpatch/README.source.gz (if you have installed dpatch) for
documentation about dpatch.

View file

@ -1,188 +0,0 @@
#!/bin/bash
# Copyright (c) 2014 Terry Burton
#
# https://github.com/terryburton/travis-github-release
#
# 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 AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
# DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
# CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
# IN THE SOFTWARE.
# This script provides a simple continuous deployment
# solution that allows Travis CI to publish a new GitHub
# release and upload assets to it whenever a tag is pushed:
# git tag; git push --tags
#
# It is created as a temporary solution whilst we wait for
# Travis DPL to support GitHub:
#
# https://github.com/travis-ci/dpl
#
# Place this script somewhere in your project repository (perhaps by forking
# the github-travis-release repo and adding your fork as a git submodule) then
# put something like this to your .travis.yml:
#
# after_success: .travis/github-release.sh "$TRAVIS_REPO_SLUG" "`head -1 src/VERSION`" build/release/*
#
# The first argument is your repository in the format
# "username/repository", which Travis provides in the
# TRAVIS_REPO_SLUG environment variable.
#
# The second argument is the release version which as a
# sanity check should match the tag that you are releasing.
# You could pass "`git describe`" to satisfy this check.
#
# The remaining arguments are a list of asset files that you
# want to publish along with the release.
#
# The script requires that you create a GitHub OAuth access
# token to facilitate the upload:
#
# https://help.github.com/articles/creating-an-access-token-for-command-line-use
#
# You must pass this securely in the GITHUBTOKEN environment
# variable:
#
# http://docs.travis-ci.com/user/encryption-keys/
#
# For testing purposes you can create a local convenience
# file in the script directory called GITHUBTOKEN that sets
# the GITHUBTOKEN environment variable. If you do so you MUST
# ensure that this doesn't get pushed to your repository,
# perhaps by adding it to a .gitignore file.
#
# Should you get stuck then look at a working example. This
# code is being used by Barcode Writer in Pure PostScript
# for automated deployment:
#
# https://github.com/terryburton/postscriptbarcode
set -e
REPO=$1 && shift
RELEASE=$1 && shift
RELEASEFILES=$@
if ! TAG=`git describe --exact-match --tags 2>/dev/null`; then
echo "This commit is not a tag so not creating a release"
exit 0
fi
if [ "$TRAVIS" = "true" ] && [ -z "$TRAVIS_TAG" ]; then
echo "This build is not for the tag so not creating a release"
exit 0
fi
if [ "$TRAVIS" = "true" ] && [ "$TRAVIS_TAG" != "$RELEASE" ]; then
echo "Error: TRAVIS_TAG ($TRAVIS_TAG) does not match the indicated release ($RELEASE)"
exit 1
fi
if [ "$TAG" != "$RELEASE" ]; then
echo "Error: The tag ($TAG) does not match the indicated release ($RELEASE)"
exit 1
fi
if [[ -z "$RELEASEFILES" ]]; then
echo "Error: No release files provided"
exit 1
fi
SCRIPTDIR=`dirname $0`
[ -e "$SCRIPTDIR/GITHUBTOKEN" ] && . "$SCRIPTDIR/GITHUBTOKEN"
if [[ -z "$GITHUBTOKEN" ]]; then
echo "Error: GITHUBTOKEN is not set"
exit 1
fi
echo "Creating GitHub release for $RELEASE"
echo -n "Create draft release... "
JSON=$(cat <<EOF
{
"tag_name": "$TAG",
"target_commitish": "master",
"name": "$TAG: New release",
"draft": true,
"prerelease": false
}
EOF
)
RESULT=`curl -s -w "\n%{http_code}\n" \
-H "Authorization: token $GITHUBTOKEN" \
-d "$JSON" \
"https://api.github.com/repos/$REPO/releases"`
if [ "`echo "$RESULT" | tail -1`" != "201" ]; then
echo FAILED
echo "$RESULT"
exit 1
fi
RELEASEID=`echo "$RESULT" | sed -ne 's/^ "id": \(.*\),$/\1/p'`
if [[ -z "$RELEASEID" ]]; then
echo FAILED
echo "$RESULT"
exit 1
fi
echo DONE
for FILE in $RELEASEFILES; do
if [ ! -f $FILE ]; then
echo "Warning: $FILE not a file"
continue
fi
FILESIZE=`stat -c '%s' "$FILE"`
FILENAME=`basename $FILE`
echo -n "Uploading $FILENAME... "
RESULT=`curl -s -w "\n%{http_code}\n" \
-H "Authorization: token $GITHUBTOKEN" \
-H "Accept: application/vnd.github.manifold-preview" \
-H "Content-Type: application/zip" \
--data-binary "@$FILE" \
"https://uploads.github.com/repos/$REPO/releases/$RELEASEID/assets?name=$FILENAME&size=$FILESIZE"`
if [ "`echo "$RESULT" | tail -1`" != "201" ]; then
echo FAILED
echo "$RESULT"
exit 1
fi
echo DONE
done
echo -n "Publishing release... "
JSON=$(cat <<EOF
{
"draft": false
}
EOF
)
RESULT=`curl -s -w "\n%{http_code}\n" \
-X PATCH \
-H "Authorization: token $GITHUBTOKEN" \
-d "$JSON" \
"https://api.github.com/repos/$REPO/releases/$RELEASEID"`
if [ "`echo "$RESULT" | tail -1`" = "200" ]; then
echo DONE
else
echo FAILED
echo "$RESULT"
exit 1
fi

282
debian/changelog vendored
View file

@ -1,282 +0,0 @@
nagios-snmp-plugins (2.1.0-4) UNRELEASED; urgency=medium
*
-- Jan Wagner <waja@cyconet.org> Mon, 23 Jan 2023 14:23:45 +0000
nagios-snmp-plugins (2.1.0-3) unstable; urgency=medium
[ Jan Wagner ]
* NOT RELEASED YET
* [4ffef41] Adding Github CI
* [071a540] Set upstream metadata fields: Bug-Database, Bug-Submit,
Repository, Repository-Browse.
* [56b1ad4] d/source/options: Adding .github to diff ignore
* [731359e] d/source/options: Fixing github ignore
[ Bas Couwenberg ]
* [9f8c997] Bump Standards-Version to 4.6.0, no changes.
* [547ca5d] Update watch file to use tags instead of releases.
* [0fef6a8] Bump Standards-Version to 4.6.1, no changes.
[ Bas Couwenberg ]
* [36ad122] Add Rules-Requires-Root to control file.
[ Jan Wagner ]
* [465be3f] d/control: Drop 'pkg-' from Vcs-Headers
[ Debian Janitor ]
* [8bb1998] Remove constraints unnecessary since buster (oldstable)
* [16004b9] Remove constraints unnecessary since buster (oldstable)
[ Jan Wagner ]
* [ea50f54] Bump debhelper from old 12 to 13.
* [4f38dec] Update standards version to 4.6.2, no changes needed.
* [a193b79] Adding d/p/19_check_snmp_int_remove_unneeded_my from upstream
* [fdc0108] Adding d/p/20_check_snmp_int_avaid_huge_amount_of_regex from
upstream
* [d4bd9c9] Adding d/p/21_check_snmp_load_update_fortiswitch_and_fortigate4.3
from upstream
* [e2bdf2d] Adding d/p/22_check_snmp_storage_fix_space_btrfs from upstream
(Closes: #959956)
-- Jan Wagner <waja@cyconet.org> Mon, 23 Jan 2023 13:45:41 +0000
nagios-snmp-plugins (2.1.0-2) unstable; urgency=medium
[ Debian Janitor ]
* Use secure copyright file specification URI.
* debian/copyright: use spaces rather than tabs to start continuation
lines.
* Bump debhelper from deprecated 5 to 12. (Closes: #965745)
* Set debhelper-compat version in Build-Depends.
* Update standards version to 4.5.0, no changes needed.
[ Jan Wagner ]
* [a75e780] Removing .travis.yml and adding .gitlab-ci.yml
[ Bas Couwenberg ]
* [e989ff9] Bump watch file version to 4.
* [b345ea5] Bump Standards-Version to 4.5.1, no changes.
[ Jan Wagner ]
* [a815051] check_snmp_int.pl: added ign-admindown, ign-emptyalias options.
fixed uninitialized variable warning by adding d/p/14_check_snmp_int_ign
from upstream
* [c1ffe3e] check_snmp_int.pl: Add spaces only if necessary by adding
d/p/15_check_snmp_int_spaces from upstream
* [ef233ba] check_snmp_win.pl: Add -o option (max message size) by adding
d/p/16_check_snmp_win_max_message_size from upstream
* [085ba7e] check_snmp_storage.pl: add support for allowing considering OK if
no storage found matching given criteria by adding
d/p/17_check_snmp_storage_okifempty from upstream
* [84561d3] check_snmp_int.pl: fix perf_out not defined error by adding
d/p/18_check_snmp_int_fix_perf_out
* [45b2b11] d/control: Updating upstream to
https://github.com/SteScho/manubulon-snmp
* [f9bf220] d/watch: Updating upstream to
https://github.com/SteScho/manubulon-snmp
* [8f6cd11] Refreshing patches
* [c1f1d25] d/copyright: Removing tabs
-- Jan Wagner <waja@cyconet.org> Mon, 07 Dec 2020 15:50:39 +0100
nagios-snmp-plugins (2.1.0-1) unstable; urgency=medium
[ Jan Wagner ]
* [75687e0] New upstream version 2.1.0
* [181c319] Refresh patches
* [568042e] d/rules: Adjust new documentation source path
* [ea34bcb] d/patches/51_fix_privacy_doc: Remove more potential privacy
breach
* [117e400] d/control: Bump Standards-Version to 4.1.1, no changes needed
* [f2e8ac9] d/docs: Fix location of the README
* [c0535e4] Adding .travis-ci.yml
* [019d443] d/control: Update VCS-headers
[ Bas Couwenberg ]
* [c07faf2] Bump Standards-Version to 4.1.5, no changes.
* [53cdb54] Bump Standards-Version to 4.2.0, no changes.
* [70b7138] Bump Standards-Version to 4.2.1, no changes.
* [3d095b1] Bump Standards-Version to 4.3.0, no changes.
[ Jan Wagner ]
* [cb66729] Delete old unused patches
* [bcc13b4] Adding d/p/10_check_snmp_storage_error_handling
* [af07b7c] Adding d/p/11_check_snmp_int_agent_workaround
* [890a780] Adding d/p/12_check_snmp_mem_perf
* [f45e77a] Adding d/p/13_check_snmp_process_new_features
* [cb17d7e] d/control: Updating Homepage-field to
https://github.com/dnsmichi/manubulon-snmp
-- Jan Wagner <waja@cyconet.org> Wed, 23 Jan 2019 20:44:01 +0100
nagios-snmp-plugins (2.0.0-1) unstable; urgency=medium
[ Bas Couwenberg ]
* [caf8f93] d/control: Update Vcs-* URLs to use HTTPS, use cgit instead of
gitweb for Vcs-Browser URL.
[ Jan Wagner ]
* [1eca1c0] travis-ci: Make use of travis.d.n
* [9c06100] New upstream version 2.0.0
* [c431132] d/watch: Update for new upstream URL
* [74388b3] Disable patches integrated in new upstream
* [6f3bacd] Refresh remaining patches
* [692a27a] d/rules: Adjusting src paths
* [3590951] d/rules: Stop shipping outdated upstream changelog
* [ceff8a0] d/docs: Adjusting src path
* [80b3d1e] d/README.Debian: Spellfix
* [d014d9b] d/rules: Fix installation location
-- Jan Wagner <waja@cyconet.org> Thu, 08 Dec 2016 09:49:39 +0100
nagios-snmp-plugins (1.1.1-12) unstable; urgency=medium
* [24809b6] travis-ci: don't install build-deps manual
* [07c8662] travis-ci: build package with dpkg-buildpackage
* [82261f2] travis-ci: Initial support for uploading releases to github
* [94da9a0] Merging upstream changes of github-release.sh
* [76f4f9b] Updating copyright and author of debian/bin/github-release.sh
* [9157b9d] Add n5k support to check_snmp_load via
19_check_snmp_load_n5k patch
* [f4871c4] Refreshing patches/01_update_pre_1.1.2
* [4a57e8b] Refreshing patches/51_fix_privacy_doc
* [e4c5a52] Adding 20_check_snmp_load_multiple_cpus
* [434d3d0] Fixing paths in 20_check_snmp_load_multiple_cpus
* [a31b428] Fixing 20_check_snmp_load_multiple_cpus
* [672a475] debian/control: reformating with warp-and-sort
* [bcecc23] travis-ci: grab actual used upstream version
* [a8f8669] Adding patchtes/21_check_snmp_load_abstract_snmp_version_check
* [f4e3f51] Adding patches/22_remove_utils_pm
* [8dd4f10] Adding patches/23_check_snmp_load_drop_debugging
* [96dcc51] travis-ci: Adding required arguments for trusty
* [6cbfcfa] travis-ci: automatically install dependencies
* [c5e9ec0] check_snmp_int: Add patches/24_check_snmp_int_use_ifname
(Closes: #812837)
* [d8d6d1b] d/rules: Use dh_prep instead of 'dh_clean -k'
-- Jan Wagner <waja@cyconet.org> Wed, 27 Jan 2016 16:23:36 +0100
nagios-snmp-plugins (1.1.1-11) unstable; urgency=medium
* [dd7632d] Create /etc/nagios-plugins/config/ (Closes: #767681)
-- Jan Wagner <waja@cyconet.org> Sun, 02 Nov 2014 20:45:10 +0100
nagios-snmp-plugins (1.1.1-10) unstable; urgency=medium
* [5dbb905] Add support for monitoring-plugins
* [f529116] Add 'libcrypt-des-perl, libcrypt-rijndael-perl' as recommends,
needed for snmp v3
* [ce65e19] Don't use symlinked license in debian/copyright
* [20f7a79] Bump Standards-Version to 3.9.6, no changes needed
-- Jan Wagner <waja@cyconet.org> Sun, 12 Oct 2014 22:23:51 +0200
nagios-snmp-plugins (1.1.1-9) unstable; urgency=low
* [976e307] Update Vcs-headers
* [950a63f] Use full binary path instead of $ macro in command definitions
* [3acf202] check_snmp_storage: Add 64bit support
* [73c21a0] Convert the package to source format 3.0 (quilt)
* [6adaea0] Fix 15_check_snmp_storage_64bit
* [074ed96] Add travis-ci config
* [36857aa] travis-ci: Reorder and comment .travis.yml
* [9ac5f8c] update git ignore regex
* [f82ac54] travis-ci: Add lintian checks after build
* [1ea9877] Add build-indep and build-arch target into debian/rules
* [36735a8] Update to recent copyright format
* [8a119de] Updating standards version to 3.9.5, no changes needed
* [aaa7106] Set set -e in the body in body of the maintainers scripts
* [d03e055] Extend the extended package description
* [2fcaf9a] Fix potential privacy breach of HTML documentation
* [1ae942a] Add upstream changelog into package
* [ab802e4] Merge latest CVS patches into one
* [34070bf] Add missing latest CVS patches
* [76a78cb] Refresh patchtes
* [6fa6c28] Update patch description 10_fix_net_snmp_version
* [0193501] Rename patch 11_fix_privacy_doc into 51_fix_privacy_doc
* [c7fb3c5] Update patch descriptions
* [4623399] Add 16_perfdata to enable perfdate
* [93834c1] Add 17_protocol_fam to support protocol and IP familiy
* [8ca89ae] Add NEWS file for changed behavior of specifying port
* [f05ed7f] Add 18_check_snmp_process_tmp_file
* [e3e176d] travis-ci: Install recent lintian version
-- Jan Wagner <waja@cyconet.org> Wed, 05 Mar 2014 22:34:26 +0100
nagios-snmp-plugins (1.1.1-8) unstable; urgency=low
* Add 10_fix_net_snmp_version.dpatch
- Fixing Net::SNMP version (Closes: #699413)
-- Jan Wagner <waja@cyconet.org> Thu, 31 Jan 2013 08:56:00 +0100
nagios-snmp-plugins (1.1.1-7) unstable; urgency=low
* Add "Copyright" to all copyrights in debian/copyright
* Updating standards version to 3.8.4
- Add README.source
* Add 1.0 to debian/source/format
* Add trailing trunk/ at Vcs-Svn-field
-- Jan Wagner <waja@cyconet.org> Wed, 10 Mar 2010 10:18:35 +0100
nagios-snmp-plugins (1.1.1-6) unstable; urgency=low
* instead of suggest depend on nagios-plugins-basic to get command
definitions installed into /etc/nagios-plugins/config and registered via
ucf, since /usr/share/nagios-plugins/dpkg/functions is used in postinst
(Closes: #513872)
-- Jan Wagner <waja@cyconet.org> Sun, 01 Feb 2009 23:49:10 +0100
nagios-snmp-plugins (1.1.1-5) unstable; urgency=low
* implement machine-interpretable copyright file
-- Jan Wagner <waja@cyconet.org> Sun, 20 Jul 2008 13:17:39 +0200
nagios-snmp-plugins (1.1.1-4) unstable; urgency=low
* adjust copyright, it's GPL2 (and not later)
* update some scripts to newest available version from website
* rename 02_disable_epn.dpatch to 50_disable_epn.dpatch to be the last one
(Closes: #484462)
* Updating standards version to 3.8.0, no changes needed
-- Jan Wagner <waja@cyconet.org> Mon, 07 Jul 2008 22:08:37 +0200
nagios-snmp-plugins (1.1.1-3) unstable; urgency=low
* change unit to bit/s in interface check
* add option for scale of bandwidth to interface check
* added Vcs- fields, moved Homepage into source header's field
* bump standards version to 3.7.3 (no changes needed)
* add 02_disable_epn.dpatch to disable epn, since the plugins don't
work with it
* bump copyright of packaging to 2008
-- Jan Wagner <waja@cyconet.org> Mon, 14 Apr 2008 23:20:52 +0200
nagios-snmp-plugins (1.1.1-2) unstable; urgency=low
* make use of dpatch infrastructure
* include a fix for check_snmp_env.pl from cvs
-- Jan Wagner <waja@cyconet.org> Fri, 6 Jul 2007 22:22:02 +0200
nagios-snmp-plugins (1.1.1-1) unstable; urgency=low
* new upstream
* include (new) html docs into package
-- Jan Wagner <waja@cyconet.org> Wed, 25 Apr 2007 22:00:50 +0200
nagios-snmp-plugins (1.1-1) unstable; urgency=low
* Initial release (Closes: #401678).
-- Jan Wagner <waja@cyconet.org> Mon, 15 Jan 2007 20:34:19 +0100

29
debian/control vendored
View file

@ -1,29 +0,0 @@
Source: nagios-snmp-plugins
Section: net
Priority: optional
Maintainer: Debian Nagios Maintainer Group <pkg-nagios-devel@lists.alioth.debian.org>
Uploaders: Jan Wagner <waja@cyconet.org>
Build-Depends: debhelper-compat (= 13)
Standards-Version: 4.6.2
Vcs-Browser: https://salsa.debian.org/nagios-team/nagios-snmp-plugins
Vcs-Git: https://salsa.debian.org/nagios-team/nagios-snmp-plugins.git
Homepage: https://github.com/SteScho/manubulon-snmp
Rules-Requires-Root: no
Package: nagios-snmp-plugins
Architecture: all
Depends: libnet-snmp-perl,
monitoring-plugins-common | nagios-plugins-basic (>= 1.4.5-2),
ucf,
${misc:Depends},
${perl:Depends}
Recommends: libcrypt-des-perl, libcrypt-rijndael-perl
Description: SNMP Plugins for nagios
A set of Nagios plugins to check hosts/devices using snmp protocol
.
The general idea of these scripts is to check as many things as possible with
snmp (how do you install NRPE on Cisco or AS/400 ?) : disks, memory, load,
interface, running procsses, etc...
.
The other idea is to select disks, interfaces, process using regular
expressions

68
debian/copyright vendored
View file

@ -1,68 +0,0 @@
Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
Upstream-Name: Nagios SNMP Plugins
Upstream-Contact: Patrick Proy (nagios at proy.org)
Source: http://www.manubulon.com/nagios
Files: *
Copyright: Copyright (C) 2004-2007 Patrick Proy (nagios at proy.org)
License: GPL-2
Files: debian/*
Copyright: Copyright (C) 2006, 2008 Jan Wagner <waja@cyconet.org>
License: GPL-2+
Files: debian/bin/github-release.sh
Copyright: Copyright (c) 2014 Terry Burton
License: Expat
License: Expat
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 AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
License: GPL-2
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License version 2 as
published by the Free Software Foundation.
.
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 St, Fifth Floor, Boston, MA 02110-1301 USA
License: GPL-2+
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 St, 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 file.

1
debian/dirs vendored
View file

@ -1 +0,0 @@
etc/nagios-plugins/config

1
debian/docs vendored
View file

@ -1 +0,0 @@
README.md

View file

@ -1,42 +0,0 @@
From e7472bfb2a39f3536350642b177e5f9e17c5c369 Mon Sep 17 00:00:00 2001
From: Louis Sautier <sautier.louis@gmail.com>
Date: Mon, 29 Jan 2018 09:17:25 +0100
Subject: [PATCH] check_snmp_storage: fix SNMP error handling, see #33
---
plugins/check_snmp_storage.pl | 15 +++++++++------
1 file changed, 9 insertions(+), 6 deletions(-)
diff --git a/plugins/check_snmp_storage.pl b/plugins/check_snmp_storage.pl
index 2325acc..3593f79 100755
--- a/plugins/check_snmp_storage.pl
+++ b/plugins/check_snmp_storage.pl
@@ -598,6 +598,15 @@ sub check_options {
$result = $session->get_request(@oids);
} else {
$result = $session->get_request(Varbindlist => \@oids);
+}
+
+if (!defined($result)) {
+ printf("ERROR getting OIDs: %s.\n", $session->error);
+ $session->close;
+ exit $ERRORS{"UNKNOWN"};
+}
+
+if (version->parse(Net::SNMP->VERSION) >= 4) {
foreach my $key (sort keys %$result) {
# Fix for filesystems larger 2 TB. More than 2 TB will cause an error because
@@ -613,12 +622,6 @@ sub check_options {
}
}
-if (!defined($result)) {
- printf("ERROR: Size table :%s.\n", $session->error);
- $session->close;
- exit $ERRORS{"UNKNOWN"};
-}
-
$session->close;
# Only a few ms left...

View file

@ -1,83 +0,0 @@
From ed1da1396f3ca3337a4ebe3f0cf610a30e6c5775 Mon Sep 17 00:00:00 2001
From: Jochen Friedrich <j.friedrich@nwe.de>
Date: Wed, 14 Mar 2018 15:31:00 +0100
Subject: [PATCH] Workaround for buggy SNMP agents not removing deleted
interfaces.
If exact match is requested, only use the interface with the highest index.
Some buggy SNMP agents forget to delete interfaces which are gone (like ppp
or tunnel interfaces).
---
plugins/check_snmp_int.pl | 57 ++++++++++++++++++++-------------------
1 file changed, 30 insertions(+), 27 deletions(-)
diff --git a/plugins/check_snmp_int.pl b/plugins/check_snmp_int.pl
index 9d4a2a5..e938131 100755
--- a/plugins/check_snmp_int.pl
+++ b/plugins/check_snmp_int.pl
@@ -632,35 +632,38 @@ sub check_options {
# get the index number of the interface
my @oid_list = split(/\./, $key);
- $tindex[$num_int] = pop(@oid_list);
-
- # get the full description
- $descr[$num_int] = $$resultat{$key};
-
- # Get rid of special caracters (specially for Windows)
- $descr[$num_int] =~ s/[[:cntrl:]]//g;
-
- # put the admin or oper oid in an array
- $oids[$num_int]
- = defined($o_admin)
- ? $admin_table . $tindex[$num_int]
- : $oper_table . $tindex[$num_int];
-
- # Put the performance oid
- if (defined($o_perf) || defined($o_checkperf)) {
- $oid_perf_inoct[$num_int] = $in_octet_table . $tindex[$num_int];
- $oid_perf_outoct[$num_int] = $out_octet_table . $tindex[$num_int];
- $oid_speed[$num_int] = $speed_table . $tindex[$num_int];
- $oid_speed_high[$num_int] = $speed_table_64 . $tindex[$num_int];
- if (defined($o_ext_checkperf) || defined($o_perfe)) {
- $oid_perf_indisc[$num_int] = $in_discard_table . $tindex[$num_int];
- $oid_perf_outdisc[$num_int] = $out_discard_table . $tindex[$num_int];
- $oid_perf_inerr[$num_int] = $in_error_table . $tindex[$num_int];
- $oid_perf_outerr[$num_int] = $out_error_table . $tindex[$num_int];
+ my $int_index = pop(@oid_list);
+ if (defined($o_noreg) && ($num_int > 0)) {
+ if ($tindex[$num_int-1] < $int_index) {
+ $num_int = 0;
}
}
- verb("Name : $descr[$num_int], Index : $tindex[$num_int]");
- $num_int++;
+ if (!defined($o_noreg) || ($num_int == 0)) {
+ $tindex[$num_int] = $int_index;
+ # get the full description
+ $descr[$num_int]=$$resultat{$key};
+ # Get rid of special caracters (specially for Windows)
+ $descr[$num_int] =~ s/[[:cntrl:]]//g;
+ # put the admin or oper oid in an array
+ $oids[$num_int]= defined ($o_admin) ? $admin_table . $tindex[$num_int]
+ : $oper_table . $tindex[$num_int];
+
+ # Put the performance oid
+ if (defined($o_perf) || defined($o_checkperf)) {
+ $oid_perf_inoct[$num_int]= $in_octet_table . $tindex[$num_int];
+ $oid_perf_outoct[$num_int]= $out_octet_table . $tindex[$num_int];
+ $oid_speed[$num_int]=$speed_table . $tindex[$num_int];
+ $oid_speed_high[$num_int]=$speed_table_64 . $tindex[$num_int];
+ if (defined($o_ext_checkperf) || defined($o_perfe)) {
+ $oid_perf_indisc[$num_int]= $in_discard_table . $tindex[$num_int];
+ $oid_perf_outdisc[$num_int]= $out_discard_table . $tindex[$num_int];
+ $oid_perf_inerr[$num_int]= $in_error_table . $tindex[$num_int];
+ $oid_perf_outerr[$num_int]= $out_error_table . $tindex[$num_int];
+ }
+ }
+ verb("Name : $descr[$num_int], Index : $tindex[$num_int]");
+ $num_int++;
+ }
}
}

View file

@ -1,85 +0,0 @@
From 8855b778e5a4aa53667baaad3863112fd93aee64 Mon Sep 17 00:00:00 2001
From: jimbobmcgee <jimbobmcgee@users.noreply.github.com>
Date: Tue, 20 Mar 2018 23:22:09 +0000
Subject: [PATCH] Better support for buffered/cached memory in Linux
Exclude buffered memory from perfdata output, if `-b` option is specified
--------------------------------------------------------------------------
Status output show RAM usage as percentage, while perfdata output shows total literal ram usage. If `-N -m` options are given, cached memory is included in both the plugin status output and the perfdata. If `-N -b` options are given, buffered memory is *excluded* from the status output, but remains *included* in the perfdata.
This patch alters the behaviour of the `-N -b` option combination so that, if supplied, buffered memory is also excluded from the perfdata.
Add separate perfdata counters for cached and buffered memory, if `-ff` options is specified
---------------------------------------------------------------------------------------------
Changed `Getopt` behaviour for `-f` so it can be specified more than once. If it is specified twice, perfdata is extended to include buffered and cached memory readings as separate perfdata values, e.g. `ram_used=12345 buffered=1234 cached=1234`. If using `-ff`, neither buffered nor cached memory are included in the perfdata value for RAM used.
---
plugins/check_snmp_mem.pl | 24 +++++++++++++-----------
1 file changed, 13 insertions(+), 11 deletions(-)
diff --git a/plugins/check_snmp_mem.pl b/plugins/check_snmp_mem.pl
index 2ac7ec9..3f93a20 100755
--- a/plugins/check_snmp_mem.pl
+++ b/plugins/check_snmp_mem.pl
@@ -95,7 +95,7 @@
sub print_usage {
print
-"Usage: $0 [-v] -H <host> -C <snmp_community> [-2] | (-l login -x passwd [-X pass -L <authp>,<privp>]) [-p <port>] [-P <protocol>] -w <warn level> -c <crit level> [-I|-N|-E] [-f] [-m -b] [-t <timeout>] [-V]\n";
+"Usage: $0 [-v] -H <host> -C <snmp_community> [-2] | (-l login -x passwd [-X pass -L <authp>,<privp>]) [-p <port>] [-P <protocol>] -w <warn level> -c <crit level> [-I|-N|-E] [-f[f]] [-m -b] [-t <timeout>] [-V]\n";
}
sub isnnum { # Return true if arg is not a number
@@ -218,8 +218,8 @@ sub check_options {
'memcache' => \$o_cache,
'b' => \$o_buffer,
'membuffer' => \$o_buffer,
- 'f' => \$o_perf,
- 'perfdata' => \$o_perf
+ 'f+' => \$o_perf,
+ 'perfdata+' => \$o_perf
);
if (defined($o_help)) { help(); exit $ERRORS{"UNKNOWN"} }
if (defined($o_version)) { p_version(); exit $ERRORS{"UNKNOWN"} }
@@ -578,9 +578,7 @@ sub check_options {
$realused = ($$resultat{$nets_ram_total} - ($$resultat{$nets_ram_free} + $totalcachedbuffered))
/ $$resultat{$nets_ram_total};
-
if ($$resultat{$nets_ram_total} == 0) { $realused = 0; }
-
$swapused
= ($$resultat{$nets_swap_total} == 0)
? 0
@@ -605,12 +603,11 @@ sub check_options {
}
$n_output .= " ; " . $n_status;
if (defined($o_perf)) {
- if (defined($o_cache)) {
- $n_output .= " | ram_used=" . ($$resultat{$nets_ram_total} - $$resultat{$nets_ram_free}) . ";";
- } else {
- $n_output .= " | ram_used="
- . ($$resultat{$nets_ram_total} - $$resultat{$nets_ram_free} - $$resultat{$nets_ram_cache}) . ";";
- }
+ my $perf_ramused = ($$resultat{$nets_ram_total} - $$resultat{$nets_ram_free});
+ $perf_ramused -= $$resultat{$nets_ram_cache} if $o_perf > 1 or !defined($o_cache);
+ $perf_ramused -= $$resultat{$nets_ram_buffer} if $o_perf > 1 or defined($o_buffer);
+
+ $n_output .= " | ram_used=$perf_ramused;";
$n_output .= ($o_warnR == 0) ? ";" : round($o_warnR * $$resultat{$nets_ram_total} / 100, 0) . ";";
$n_output .= ($o_critR == 0) ? ";" : round($o_critR * $$resultat{$nets_ram_total} / 100, 0) . ";";
$n_output .= "0;" . $$resultat{$nets_ram_total} . " ";
@@ -618,6 +615,11 @@ sub check_options {
$n_output .= ($o_warnS == 0) ? ";" : round($o_warnS * $$resultat{$nets_swap_total} / 100, 0) . ";";
$n_output .= ($o_critS == 0) ? ";" : round($o_critS * $$resultat{$nets_swap_total} / 100, 0) . ";";
$n_output .= "0;" . $$resultat{$nets_swap_total};
+
+ if ($o_perf > 1) {
+ $n_output .= " buffered=" . $$resultat{$nets_ram_buffer} . ';;;0;' . $$resultat{$nets_ram_total};
+ $n_output .= " cached=" . $$resultat{$nets_ram_cache} . ';;;0;' . $$resultat{$nets_ram_total};
+ }
}
$session->close;
print "$n_output \n";

View file

@ -1,348 +0,0 @@
From 9ceabfc974d4d9bfd0731bbedfa12a035a662466 Mon Sep 17 00:00:00 2001
From: jimbobmcgee <jimbobmcgee@users.noreply.github.com>
Date: Tue, 20 Mar 2018 23:28:12 +0000
Subject: [PATCH] Minor feature updates to check_snmp_process.pl
The following features are included:
1. Added new `-T` option, to report/check against the total RAM of all matched processes, rather than the highest value
2. Warn/Crit values are now optional for `-m` and `-u` options, allowing for capture of these in perfdata without requiring thresholds
3. Perfdata is now always written if `-F` is supplied, even if there were no matched process (i.e. `num_process=0 memory_usage=0 cpu_usage=0`).
---
plugins/check_snmp_process.pl | 201 +++++++++++++++++++++-------------
1 file changed, 125 insertions(+), 76 deletions(-)
diff --git a/plugins/check_snmp_process.pl b/plugins/check_snmp_process.pl
index 49a8cd7..2d2f72e 100755
--- a/plugins/check_snmp_process.pl
+++ b/plugins/check_snmp_process.pl
@@ -44,9 +44,9 @@
my $o_domain = 'udp/ipv4'; # Default to UDP over IPv4
my $o_version2 = undef; #use snmp v2c
my $o_descr = undef; # description filter
-my $o_warn = 0; # warning limit
+my $o_warn = undef; # warning limit
my @o_warnL = undef; # warning limits (min,max)
-my $o_crit = 0; # critical limit
+my $o_crit = undef; # critical limit
my @o_critL = undef; # critical limits (min,max)
my $o_help = undef; # wan't some help ?
my $o_verb = undef; # verbose mode
@@ -74,17 +74,22 @@
my $o_mem = undef; # checks memory (max)
my @o_memL = undef; # warn and crit level for mem
my $o_mem_avg = undef; # cheks memory average
+my $o_mem_sum = undef; # checks memory total
my $o_cpu = undef; # checks CPU usage
my @o_cpuL = undef; # warn and crit level for cpu
-my $o_delta = $delta_of_time_to_make_average; # delta time for CPU check
+my $o_delta = undef; # delta time for CPU check
# functions
sub p_version { print "check_snmp_process version : $VERSION\n"; }
sub print_usage {
- print
-"Usage: $0 [-v] -H <host> -C <snmp_community> [-2] | (-l login -x passwd) [-p <port>] [-P <IP Protocol>] -n <name> [-w <min_proc>[,<max_proc>] -c <min_proc>[,max_proc] ] [-m<warn Mb>,<crit Mb> -a -u<warn %>,<crit%> -d<delta> ] [-t <timeout>] [-o <octet_length>] [-f -A -F ] [-r] [-V] [-g]\n";
+ print "Usage: $0 [-v] -H <host> [-p <port>] [-P <IP Protocol>] "
+ . "((-C <snmp_community> [-2]) | (-l login -x passwd)) "
+ . "-n <name> [-f] [-A] [-r] [-w <min_proc>[,<max_proc>] -c <min_proc>[,<max_proc>]] "
+ . "[-m [<warnMB>,<critMB>] [-a|-T]] "
+ . "[-u [<warn%>,<crit%>] -d<delta>] "
+ . "[-t <timeout>] [-o <octet_length>] [-F] [-V] [-g]\n";
}
sub isnotnum { # Return true if arg is not a number
@@ -186,7 +191,7 @@ sub help {
ex : "named.*-t /var/named/chroot" will only select named process with this parameter
-F, --perfout
Add performance output
- outputs : memory_usage, num_process, cpu_usage
+ outputs: num_processes, memory_usage (if -m), cpu_usage (if -u)
-w, --warn=MIN[,MAX]
Number of process that will cause a warning
-1 for no warning, MAX must be >0. Ex : -w-1,50
@@ -197,15 +202,21 @@ sub help {
with the following options : -w m1,x1 -c m2,x2
you must have : m2 <= m1 < x1 <= x2
you can omit x1 or x2 or both
--m, --memory=WARN,CRIT
+-m, --memory[=WARN,CRIT]
checks memory usage (default max of all process)
- values are warning and critical values in Mb
+ WARN,CRIT values are warning and critical values in MB
+ if WARN,CRIT values are not given, just report
-a, --average
makes an average of memory used by process instead of max
--u, --cpu=WARN,CRIT
+ (implies -m, cannot be used with -T)
+-T, --total
+ checks the total memory used by processes instead of max
+ (implies -m, cannot be used with -a)
+-u, --cpu[=WARN,CRIT]
checks cpu usage of all process
values are warning and critical values in % of CPU usage
if more than one CPU, value can be > 100% : 100%=1 CPU
+ if WARN,CRIT values are not given, just report
-d, --delta=seconds
make an average of <delta> seconds for CPU (default 300=5min)
-g, --getall
@@ -272,6 +283,8 @@ sub check_options {
'memory:s' => \$o_mem,
'a' => \$o_mem_avg,
'average' => \$o_mem_avg,
+ 'T' => \$o_mem_sum,
+ 'total' => \$o_mem_sum,
'u:s' => \$o_cpu,
'cpu' => \$o_cpu,
'2' => \$o_version2,
@@ -327,9 +340,11 @@ sub check_options {
# Check compulsory attributes
if (!defined($o_descr) || !defined($o_host)) { print_usage(); exit $ERRORS{"UNKNOWN"} }
- @o_warnL = split(/,/, $o_warn);
- @o_critL = split(/,/, $o_crit);
- verb("$o_warn $o_crit $#o_warnL $#o_critL");
+
+ # Check warn/crit values
+ @o_warnL = split(/,/, ($o_warn // "0"));
+ @o_critL = split(/,/, ($o_crit // "0"));
+ verb("Warn: " . ($o_warn // "undef") . "; Crit: " . ($o_crit // "undef") . "; #Warn: " . $#o_warnL . "; #Crit: " . $#o_critL);
if (isnotnum($o_warnL[0]) || isnotnum($o_critL[0])) {
print "Numerical values for warning and critical\n";
print_usage();
@@ -348,7 +363,6 @@ sub check_options {
exit $ERRORS{"UNKNOWN"};
}
- # Check min_crit < min warn < max warn < crit warn
if ($o_warnL[0] < $o_critL[0]) {
print " warn minimum must be >= crit minimum\n";
print_usage();
@@ -371,7 +385,15 @@ sub check_options {
exit $ERRORS{"UNKNOWN"};
}
#### Memory checks
- if (defined($o_mem)) {
+ if (defined($o_mem_sum) && defined($o_mem_avg)) {
+ print "cannot test memory average and memory total\n";
+ print_usage();
+ exit $ERRORS{"UNKNOWN"};
+ }
+ if (defined($o_mem_sum) || defined($o_mem_avg)) {
+ $o_mem = $o_mem // "";
+ }
+ if (defined($o_mem) && length($o_mem)) {
@o_memL = split(/,/, $o_mem);
if ($#o_memL != 1) { print "2 values (warning,critical) for memory\n"; print_usage(); exit $ERRORS{"UNKNOWN"} }
if (isnotnum($o_memL[0]) || isnotnum($o_memL[1])) {
@@ -386,7 +408,16 @@ sub check_options {
}
}
#### CPU checks
- if (defined($o_cpu)) {
+ if (defined($o_delta)) {
+ if (isnotnum($o_delta)) {
+ print "Numeric values for delta!\n";
+ print_usage();
+ exit $ERRORS{"UNKNOWN"};
+ }
+ $o_cpu = $o_cpu // "";
+ }
+ if (defined($o_cpu) && length($o_cpu)) {
+ $o_delta = $o_delta // $delta_of_time_to_make_average;
@o_cpuL = split(/,/, $o_cpu);
if ($#o_cpuL != 1) { print "2 values (warning,critical) for cpu\n"; print_usage(); exit $ERRORS{"UNKNOWN"} }
if (isnotnum($o_cpuL[0]) || isnotnum($o_cpuL[1])) {
@@ -619,24 +650,11 @@ sub check_options {
}
}
-if ($num_int == 0) {
- print "No process ", (defined($o_noreg)) ? "named " : "matching ", $o_descr, " found : ";
- if ($o_critL[0] >= 0) {
- print "CRITICAL\n";
- exit $ERRORS{"CRITICAL"};
- } elsif ($o_warnL[0] >= 0) {
- print "WARNING\n";
- exit $ERRORS{"WARNING"};
- }
- print "YOU told me it was : OK\n";
- exit $ERRORS{"OK"};
-}
-
my $result = undef;
my $num_int_ok = 0;
# Splitting snmp request because can't use get_bulk_request with v1 protocol
-if (!defined($o_get_all)) {
+if ($num_int != 0 && !defined($o_get_all)) {
if ($count_oid >= 50) {
my @toid = undef;
my $tmp_num = 0;
@@ -697,13 +715,21 @@ sub check_options {
my ($res_memory, $res_cpu) = (0, 0);
my $memory_print = "";
my $cpu_print = "";
+
###### Checks memory usage
if (defined($o_mem)) {
- if (defined($o_mem_avg)) {
- for (my $i = 0; $i < $num_int; $i++) { $res_memory += $result_cons{ $proc_mem_table . "." . $tindex[$i] }; }
- $res_memory /= ($num_int_ok * 1024);
- verb("Memory average : $res_memory");
+ if (defined($o_mem_avg) || defined($o_mem_sum)) {
+ verb("Check average: " . ($o_mem_avg // 0) . "; total: " . ($o_mem_sum // 0));
+ for (my $i = 0; $i < $num_int; $i++) {
+ $res_memory += $result_cons{ $proc_mem_table . "." . $tindex[$i] };
+ }
+ $res_memory /= 1024; # to Mbytes
+ verb("Memory total : $res_memory MB");
+ if (defined($o_mem_avg)) {
+ $res_memory /= $num_int_ok;
+ verb("Memory average : $res_memory MB");
+ }
} else {
for (my $i = 0; $i < $num_int; $i++) {
$res_memory
@@ -714,17 +740,22 @@ sub check_options {
$res_memory /= 1024;
verb("Memory max : $res_memory");
}
- if ($res_memory > $o_memL[1]) {
- $final_status = 2;
- $memory_print = ", Mem : " . sprintf("%.1f", $res_memory) . "Mb > " . $o_memL[1] . " CRITICAL";
- } elsif ($res_memory > $o_memL[0]) {
- $final_status = 1;
- $memory_print = ", Mem : " . sprintf("%.1f", $res_memory) . "Mb > " . $o_memL[0] . " WARNING";
- } else {
- $memory_print = ", Mem : " . sprintf("%.1f", $res_memory) . "Mb OK";
- }
if (defined($o_perf)) {
- $perf_output = "'memory_usage'=" . sprintf("%.1f", $res_memory) . "MB;" . $o_memL[0] . ";" . $o_memL[1];
+ $perf_output = "'memory_usage'=" . sprintf("%.1f", $res_memory) . "MB";
+ }
+ if (length($o_mem)) {
+ if ($res_memory > $o_memL[1]) {
+ $final_status = 2;
+ $memory_print = ", Mem : " . sprintf("%.1f", $res_memory) . "MB > " . $o_memL[1] . " CRITICAL";
+ } elsif ($res_memory > $o_memL[0]) {
+ $final_status = 1;
+ $memory_print = ", Mem : " . sprintf("%.1f", $res_memory) . "MB > " . $o_memL[0] . " WARNING";
+ } else {
+ $memory_print = ", Mem : " . sprintf("%.1f", $res_memory) . "MB OK";
+ }
+ if (defined($o_perf)) {
+ $perf_output .= ";" . $o_memL[0] . ";" . $o_memL[1];
+ }
}
}
@@ -789,19 +820,24 @@ sub check_options {
if ($return != 0) { $cpu_print .= "! ERROR writing file $temp_file_name !"; $final_status = 3; }
##### Check values (if something to check...)
if (defined($found_value)) {
- if ($found_value > $o_cpuL[1]) {
- $final_status = 2;
- $cpu_print .= ", Cpu : " . sprintf("%.0f", $found_value) . "% > " . $o_cpuL[1] . " CRITICAL";
- } elsif ($found_value > $o_cpuL[0]) {
- $final_status = ($final_status == 2) ? 2 : 1;
- $cpu_print .= ", Cpu : " . sprintf("%.0f", $found_value) . "% > " . $o_cpuL[0] . " WARNING";
- } else {
- $cpu_print .= ", Cpu : " . sprintf("%.0f", $found_value) . "% OK";
- }
if (defined($o_perf)) {
if (!defined($perf_output)) { $perf_output = ""; }
else { $perf_output .= " "; }
- $perf_output .= "'cpu_usage'=" . sprintf("%.0f", $found_value) . "%;" . $o_cpuL[0] . ";" . $o_cpuL[1];
+ $perf_output .= "'cpu_usage'=" . sprintf("%.0f", $found_value) . "%";
+ }
+ if (length($o_cpu)) {
+ if ($found_value > $o_cpuL[1]) {
+ $final_status = 2;
+ $cpu_print .= ", CPU : " . sprintf("%.0f", $found_value) . "% > " . $o_cpuL[1] . " CRITICAL";
+ } elsif ($found_value > $o_cpuL[0]) {
+ $final_status = ($final_status == 2) ? 2 : 1;
+ $cpu_print .= ", CPU : " . sprintf("%.0f", $found_value) . "% > " . $o_cpuL[0] . " WARNING";
+ } else {
+ $cpu_print .= ", CPU : " . sprintf("%.0f", $found_value) . "% OK";
+ }
+ if (defined($o_perf)) {
+ $perf_output .= ";" . $o_cpuL[0] . ";" . $o_cpuL[1];
+ }
}
} else {
if ($final_status == 0) { $final_status = 3 }
@@ -809,35 +845,48 @@ sub check_options {
}
}
-print $num_int_ok, " process ", (defined($o_noreg)) ? "named " : "matching ", $o_descr, " ";
-
-#### Check for min and max number of process
-if ($num_int_ok <= $o_critL[0]) {
- print "(<= ", $o_critL[0], " : CRITICAL)";
- $final_status = 2;
-} elsif ($num_int_ok <= $o_warnL[0]) {
- print "(<= ", $o_warnL[0], " : WARNING)";
- $final_status = ($final_status == 2) ? 2 : 1;
-} else {
- print "(> ", $o_warnL[0], ")";
+if ($num_int == 0) {
+ print "No processes ", (defined($o_noreg) ? "named " : "matching "), $o_descr, " found : ";
+ if ($o_critL[0] >= 0) {
+ print "CRITICAL";
+ $final_status = 2;
+ } elsif ($o_warnL[0] >= 0) {
+ print "WARNING";
+ $final_status = ($final_status == 2) ? 2 : 1;
+ }
}
-if (defined($o_critL[1]) && ($num_int_ok > $o_critL[1])) {
- print " (> ", $o_critL[1], " : CRITICAL)";
- $final_status = 2;
-} elsif (defined($o_warnL[1]) && ($num_int_ok > $o_warnL[1])) {
- print " (> ", $o_warnL[1], " : WARNING)";
- $final_status = ($final_status == 2) ? 2 : 1;
-} elsif (defined($o_warnL[1])) {
- print " (<= ", $o_warnL[1], "):OK";
+else {
+ print $num_int_ok, " process", ($num_int_ok == 1 ? " " : "es "), (defined($o_noreg) ? "named " : "matching "), $o_descr, " ";
+
+ #### Check for min and max number of process
+ if ($num_int_ok <= $o_critL[0]) {
+ print "(<= ", $o_critL[0], " : CRITICAL)";
+ $final_status = 2;
+ } elsif ($num_int_ok <= $o_warnL[0]) {
+ print "(<= ", $o_warnL[0], " : WARNING)";
+ $final_status = ($final_status == 2) ? 2 : 1;
+ } else {
+ print "(> ", $o_warnL[0], ")";
+ }
+ if (defined($o_critL[1]) && ($num_int_ok > $o_critL[1])) {
+ print " (> ", $o_critL[1], " : CRITICAL)";
+ $final_status = 2;
+ } elsif (defined($o_warnL[1]) && ($num_int_ok > $o_warnL[1])) {
+ print " (> ", $o_warnL[1], " : WARNING)";
+ $final_status = ($final_status == 2) ? 2 : 1;
+ } elsif (defined($o_warnL[1])) {
+ print " (<= ", $o_warnL[1], "):OK";
+ }
}
print $memory_print, $cpu_print;
if (defined($o_perf)) {
- if (!defined($perf_output)) { $perf_output = ""; }
- else { $perf_output .= " "; }
- $perf_output .= "'num_process'=" . $num_int_ok . ";" . $o_warnL[0] . ";" . $o_critL[0];
- print " | ", $perf_output;
+ print " | 'num_process'=" . $num_int_ok;
+ print ";" . $o_warnL[0] if defined($o_warn);
+ print ";" if defined($o_crit) && !defined($o_warn);
+ print ";" . $o_critL[0] if defined($o_crit);
+ print " " . $perf_output if length($perf_output // "");
}
print "\n";

View file

@ -1,187 +0,0 @@
From 2d11bcf5c884793eb21a946fdd04cf87baf57ad3 Mon Sep 17 00:00:00 2001
From: Stanislav Datskevych <me@nek0.net>
Date: Wed, 9 Jan 2019 11:25:39 +0100
Subject: [PATCH] added ign-admindown, ign-emptyalias options. fixed
unitialized variable warning
---
plugins/check_snmp_int.pl | 98 +++++++++++++++++++++++++++++++--------
1 file changed, 79 insertions(+), 19 deletions(-)
diff --git a/plugins/check_snmp_int.pl b/plugins/check_snmp_int.pl
index e938131..721c3b2 100755
--- a/plugins/check_snmp_int.pl
+++ b/plugins/check_snmp_int.pl
@@ -35,7 +35,7 @@
my $name_table = '1.3.6.1.2.1.31.1.1.1.1';
my $alias_table = '.1.3.6.1.2.1.31.1.1.1.18';
my $oper_table = '1.3.6.1.2.1.2.2.1.8.';
-my $admin_table = '1.3.6.1.2.1.2.2.1.7.';
+my $admin_table = '1.3.6.1.2.1.2.2.1.7';
my $speed_table = '1.3.6.1.2.1.2.2.1.5.';
my $speed_table_64 = '1.3.6.1.2.1.31.1.1.1.15.';
my $in_octet_table = '1.3.6.1.2.1.2.2.1.10.';
@@ -60,20 +60,22 @@
# Globals
# Standard options
-my $o_host = undef; # hostname
-my $o_port = 161; # port
-my $o_descr = undef; # description filter
-my $o_help = undef; # wan't some help ?
-my $o_admin = undef; # admin status instead of oper
-my $o_inverse = undef; # Critical when up
-my $o_dormant = undef; # Dormant state is OK
-my $o_down = undef; # Down state is OK
-my $o_verb = undef; # verbose mode
-my $o_version = undef; # print version
-my $o_noreg = undef; # Do not use Regexp for name
-my $o_short = undef; # set maximum of n chars to be displayed
-my $o_label = undef; # add label before speed (in, out, etc...).
-my $o_weather = undef; # output "weathermap" data for NagVis
+my $o_host = undef; # hostname
+my $o_port = 161; # port
+my $o_descr = undef; # description filter
+my $o_help = undef; # wan't some help ?
+my $o_admin = undef; # admin status instead of oper
+my $o_inverse = undef; # Critical when up
+my $o_dormant = undef; # Dormant state is OK
+my $o_down = undef; # Down state is OK
+my $o_ignore_admindown = undef; # Ignore interfaces in admin down state
+my $o_ignore_emptyalias = undef; # ignore interfaces with empty alias (interface description string)
+my $o_verb = undef; # verbose mode
+my $o_version = undef; # print version
+my $o_noreg = undef; # Do not use Regexp for name
+my $o_short = undef; # set maximum of n chars to be displayed
+my $o_label = undef; # add label before speed (in, out, etc...).
+my $o_weather = undef; # output "weathermap" data for NagVis
# Performance data options
my $o_perf = undef; # Output performance data
@@ -224,6 +226,10 @@ sub help {
Dormant state is an OK state
--down
Down state is an OK state
+--ign-admindown
+ Ignore interfaces in Admin down state
+--ign-emptyalias
+ Ignore interfaces having empty alias (port description)
-o, --octetlength=INTEGER
max-size of the SNMP message, usefull in case of Too Long responses.
Be carefull with network filters. Range 484 - 65535, default are
@@ -358,7 +364,9 @@ sub check_options {
'dormant' => \$o_dormant,
'down' => \$o_down,
'W' => \$o_weather,
- 'weather' => \$o_weather
+ 'weather' => \$o_weather,
+ 'ign-admindown' => \$o_ignore_admindown,
+ 'ign-emptyalias' => \$o_ignore_emptyalias,
);
if (defined($o_help)) { help(); exit $ERRORS{"UNKNOWN"} }
if (defined($o_version)) { p_version(); exit $ERRORS{"UNKNOWN"} }
@@ -489,6 +497,14 @@ sub check_options {
print_usage();
exit $ERRORS{"UNKNOWN"};
}
+
+ #### check if --admin and --ign-admindown are put together.
+ #### --ign-admindown expects the open_state of the port to be used
+ if (defined($o_ignore_admindown) && defined($o_admin)) {
+ print "ERROR: --ign-admindown and -a are mutually exclusive. Please select only one.\n\n";
+ print_usage();
+ exit $ERRORS{"UNKNOWN"};
+ }
}
########## MAIN #######
@@ -616,6 +632,31 @@ sub check_options {
$in_octet_table = $in_octet_table_64;
}
+# If --ign-admindown is set, we need to have admin status table
+my $admin_status_table;
+if (defined($o_ignore_admindown)) {
+ $admin_status_table = $session->get_table(Baseoid => $admin_table);
+
+ if (!defined($admin_status_table)) {
+ printf("ERROR: Admin status table : %s.\n", $session->error);
+ $session->close;
+ exit $ERRORS{"UNKNOWN"};
+ }
+}
+
+# If --ign-emptyalias is set, we need to have aliases table
+my $interfaces_aliases;
+if (defined($o_ignore_emptyalias)) {
+ $interfaces_aliases = $session->get_table(Baseoid => $alias_table);
+
+ if (!defined($interfaces_aliases)) {
+ printf("ERROR: Alias status table : %s.\n", $session->error);
+ $session->close;
+ exit $ERRORS{"UNKNOWN"};
+ }
+}
+
+
# Select interface by regexp of exact match
# and put the oid to query in an array
@@ -623,12 +664,30 @@ sub check_options {
foreach my $key (sort { $$resultat{$a} cmp $$resultat{$b} } keys %$resultat) {
verb("OID : $key, Desc : $$resultat{$key}");
+ my $ignore = 0;
+ my $prefix = $query_table . ".";
+ my ($ifindex) = $key =~ /$prefix(\d+)$/;
+
+ # if ign-admindown is set, check the ifIndex against admin status
+ if (defined($o_ignore_admindown)) {
+ my $index = $admin_table . "." . $ifindex;
+ my $admstatus = $$admin_status_table{$index};
+ $ignore = 1 if ($admstatus == 2);
+ }
+
+ # if ign-emptyalias is set, check the ifIndex against alias string
+ if (defined($o_ignore_emptyalias)) {
+ my $index = $alias_table . "." . $ifindex;
+ my $alias = $$interfaces_aliases{$index};
+ $ignore = 1 if ($alias eq "");
+ }
+
# test by regexp or exact match
my $test
= defined($o_noreg)
? $$resultat{$key} eq $o_descr
: $$resultat{$key} =~ /$o_descr/;
- if ($test) {
+ if ($test && !$ignore) {
# get the index number of the interface
my @oid_list = split(/\./, $key);
@@ -645,7 +704,7 @@ sub check_options {
# Get rid of special caracters (specially for Windows)
$descr[$num_int] =~ s/[[:cntrl:]]//g;
# put the admin or oper oid in an array
- $oids[$num_int]= defined ($o_admin) ? $admin_table . $tindex[$num_int]
+ $oids[$num_int]= defined ($o_admin) ? $admin_table . "." . $tindex[$num_int]
: $oper_table . $tindex[$num_int];
# Put the performance oid
@@ -724,7 +783,7 @@ sub check_options {
# Get the status of the current interface
my $int_status
= defined($o_admin)
- ? $$result{ $admin_table . $tindex[$i] }
+ ? $$result{ $admin_table . "." . $tindex[$i] }
: $$result{ $oper_table . $tindex[$i] };
# Make the bandwith & error checks if necessary
@@ -976,6 +1035,7 @@ sub check_options {
$perf_out .= "'" . $descr[$i] =~ s/\./_/r . "_out_discard'=" . $$result{ $oid_perf_outdisc[$i] } . "c ";
}
if (defined($o_perfs)) {
+ my $speed_real = "" unless (defined($speed_real));
$perf_out .= "'" . $descr[$i] =~ s/\./_/r . "_speed_bps'=" . $speed_real . " ";
}
if (defined($o_weather) && $usable_data == 1) {

View file

@ -1,32 +0,0 @@
From 8f1c304b82c7bd9f5d1b23faa91ba86b0f99c4e2 Mon Sep 17 00:00:00 2001
From: PGranado <pgranado@pt.lu>
Date: Fri, 22 Mar 2019 15:05:32 +0100
Subject: [PATCH] Add spaces only if necessary, resolving bug #32
---
plugins/check_snmp_int.pl | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
--- a/plugins/check_snmp_int.pl
+++ b/plugins/check_snmp_int.pl
@@ -777,7 +777,7 @@
# make all checks and output for all interfaces
for (my $i = 0; $i < $num_int; $i++) {
$print_out .= ", " if (defined($print_out));
- $perf_out .= " " if (defined($perf_out));
+
my $usable_data = 1;
# Get the status of the current interface
@@ -785,7 +785,10 @@
= defined($o_admin)
? $$result{ $admin_table . "." . $tindex[$i] }
: $$result{ $oper_table . $tindex[$i] };
-
+
+ # Add spaces only if necessary
+ $perf_out .= " " if (defined ($perf_out) && $int_status==2 ) ;
+
# Make the bandwith & error checks if necessary
if (defined($o_checkperf) && $int_status == 1) {
$temp_file_name = $descr[$i];

View file

@ -1,178 +0,0 @@
From dc67e601453a564db68d7921f16fb6ea875f68be Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Mathias=20V=C3=A9drines?= <mvedrines@capensis.fr>
Date: Fri, 21 Feb 2020 12:18:53 +0100
Subject: [PATCH] Add -o option (max message size) in check_snmp_win
---
plugins/check_snmp_win.pl | 121 +++++++++++++++++++++++---------------
1 file changed, 72 insertions(+), 49 deletions(-)
diff --git a/plugins/check_snmp_win.pl b/plugins/check_snmp_win.pl
index 148d6eb..c5cb573 100755
--- a/plugins/check_snmp_win.pl
+++ b/plugins/check_snmp_win.pl
@@ -47,24 +47,25 @@
my $Name = 'check_snmp_win';
-my $o_host = undef; # hostname
-my $o_community = undef; # community
-my $o_port = 161; # port
-my $o_version2 = undef; #use snmp v2c
-my $o_descr = undef; # description filter
-my @o_descrL = undef; # Service descriprion list.
-my $o_showall = undef; # Show all services even if OK
-my $o_type = "service"; # Check type (service, ...)
-my $o_number = undef; # Number of service for warn and crit levels
-my $o_help = undef; # wan't some help ?
-my $o_verb = undef; # verbose mode
-my $o_version = undef; # print version
-my $o_noreg = undef; # Do not use Regexp for name
-my $o_timeout = 5; # Default 5s Timeout
+my $o_host = undef; # hostname
+my $o_community = undef; # community
+my $o_port = 161; # port
+my $o_version2 = undef; # use snmp v2c
+my $o_descr = undef; # description filter
+my @o_descrL = undef; # Service descriprion list.
+my $o_showall = undef; # Show all services even if OK
+my $o_type = "service"; # Check type (service, ...)
+my $o_number = undef; # Number of service for warn and crit levels
+my $o_help = undef; # wan't some help ?
+my $o_verb = undef; # verbose mode
+my $o_version = undef; # print version
+my $o_noreg = undef; # Do not use Regexp for name
+my $o_timeout = 5; # Default 5s Timeout
+my $o_octetlength = undef; # SNMP max message size
# SNMP V3 specific
-my $o_login = undef; # snmp v3 login
-my $o_passwd = undef; # snmp v3 passwd
+my $o_login = undef; # snmp v3 login
+my $o_passwd = undef; # snmp v3 passwd
# functions
@@ -72,7 +73,7 @@
sub print_usage {
print
-"Usage: $Name [-v] -H <host> -C <snmp_community> [-2] | (-l login -x passwd) [-p <port>] -n <name>[,<name2] [-T=service] [-r] [-s] [-N=<n>] [-t <timeout>] [-V]\n";
+"Usage: $Name [-v] -H <host> -C <snmp_community> [-2] | (-l login -x passwd) [-p <port>] -n <name>[,<name2] [-T=service] [-r] [-s] [-N=<n>] [-t <timeout>] [-o <octet_length>] [-V]\n";
}
sub isnotnum { # Return true if arg is not a number
@@ -128,6 +129,8 @@ sub help {
Do not use regexp to match NAME in service description.
-t, --timeout=INTEGER
timeout for SNMP in seconds (Default: 5)
+-o, --octetlength=INTEGER
+ SNMP max message size (484-65535)
-V, --version
prints version number
Note :
@@ -162,36 +165,38 @@ sub decode_utf8 { # just replaces UFT8 caracters by "."
sub check_options {
Getopt::Long::Configure("bundling");
GetOptions(
- 'v' => \$o_verb,
- 'verbose' => \$o_verb,
- 'h' => \$o_help,
- 'help' => \$o_help,
- 'H:s' => \$o_host,
- 'hostname:s' => \$o_host,
- 'p:i' => \$o_port,
- 'port:i' => \$o_port,
- 'C:s' => \$o_community,
- 'community:s' => \$o_community,
- 'l:s' => \$o_login,
- 'login:s' => \$o_login,
- 'x:s' => \$o_passwd,
- 'passwd:s' => \$o_passwd,
- 't:i' => \$o_timeout,
- 'timeout:i' => \$o_timeout,
- 'n:s' => \$o_descr,
- 'name:s' => \$o_descr,
- 'r' => \$o_noreg,
- 'noregexp' => \$o_noreg,
- 'T:s' => \$o_type,
- 'type:s' => \$o_type,
- 'N:i' => \$o_number,
- 'number:i' => \$o_number,
- '2' => \$o_version2,
- 'v2c' => \$o_version2,
- 's' => \$o_showall,
- 'showall' => \$o_showall,
- 'V' => \$o_version,
- 'version' => \$o_version
+ 'v' => \$o_verb,
+ 'verbose' => \$o_verb,
+ 'h' => \$o_help,
+ 'help' => \$o_help,
+ 'H:s' => \$o_host,
+ 'hostname:s' => \$o_host,
+ 'p:i' => \$o_port,
+ 'port:i' => \$o_port,
+ 'C:s' => \$o_community,
+ 'community:s' => \$o_community,
+ 'l:s' => \$o_login,
+ 'login:s' => \$o_login,
+ 'x:s' => \$o_passwd,
+ 'passwd:s' => \$o_passwd,
+ 't:i' => \$o_timeout,
+ 'timeout:i' => \$o_timeout,
+ 'n:s' => \$o_descr,
+ 'name:s' => \$o_descr,
+ 'r' => \$o_noreg,
+ 'noregexp' => \$o_noreg,
+ 'T:s' => \$o_type,
+ 'type:s' => \$o_type,
+ 'N:i' => \$o_number,
+ 'number:i' => \$o_number,
+ '2' => \$o_version2,
+ 'v2c' => \$o_version2,
+ 'o:i' => \$o_octetlength,
+ 'octetlength:i' => \$o_octetlength,
+ 's' => \$o_showall,
+ 'showall' => \$o_showall,
+ 'V' => \$o_version,
+ 'version' => \$o_version
);
if (defined($o_help)) { help(); exit $ERRORS{"UNKNOWN"} }
if (defined($o_version)) { p_version(); exit $ERRORS{"UNKNOWN"} }
@@ -222,6 +227,13 @@ sub check_options {
}
}
+ # Octet length check
+ if (defined($o_octetlength) && (isnotnum($o_octetlength) || $o_octetlength > 65535 || $o_octetlength < 484)) {
+ print "octet length must be in range 484 .. 65535\n";
+ print_usage();
+ exit $ERRORS{'UNKNOWN'};
+ }
+
}
########## MAIN #######
@@ -283,8 +295,19 @@ sub check_options {
exit $ERRORS{"UNKNOWN"};
}
-$session->max_msg_size(5000);
-verb($session->max_msg_size);
+if (defined($o_octetlength)) {
+ my $oct_resultat = undef;
+ my $oct_test = $session->max_msg_size();
+ verb(" actual max octets:: $oct_test");
+ $oct_resultat = $session->max_msg_size($o_octetlength);
+ if (!defined($oct_resultat)) {
+ printf("ERROR: Session settings : %s.\n", $session->error);
+ $session->close;
+ exit $ERRORS{"UNKNOWN"};
+ }
+ $oct_test = $session->max_msg_size();
+ verb(" new max octets:: $oct_test");
+}
# Look for process in name or path name table
my $resultat = undef;

View file

@ -1,61 +0,0 @@
From fd5ae19315a26530159f8ab221a190ac52de3195 Mon Sep 17 00:00:00 2001
From: roa <roa@eurotux.com>
Date: Mon, 9 Mar 2020 11:56:04 +0000
Subject: [PATCH] check_snmp_storage.pl: add support for allowing considering
OK if no storage found matching given criteria
---
plugins/check_snmp_storage.pl | 12 ++++++++++--
1 file changed, 10 insertions(+), 2 deletions(-)
diff --git a/plugins/check_snmp_storage.pl b/plugins/check_snmp_storage.pl
index 3593f79..887800a 100755
--- a/plugins/check_snmp_storage.pl
+++ b/plugins/check_snmp_storage.pl
@@ -73,6 +73,7 @@
my $o_sum = undef; # add all storage before testing
my $o_index = undef; # Parse index instead of description
my $o_negate = undef; # Negate the regexp if set
+my $o_okifempty = undef; # Consider OK if no disks found
my $o_timeout = 5; # Default 5s Timeout
my $o_perf = undef; # Output performance data
my $o_short = undef; # Short output parameters
@@ -98,7 +99,7 @@
sub print_usage {
print
-"Usage: $Name [-v] -H <host> -C <snmp_community> [-2] | (-l login -x passwd [-X pass -L <authp>,<privp>]) [-p <port>] [-P <protocol>] -m <name in desc_oid> [-q storagetype] -w <warn_level> -c <crit_level> [-t <timeout>] [-T pl|pu|bl|bu ] [-r -s -i -G] [-e] [-S 0|1[,1,<car>]] [-o <octet_length>] [-R <% reserved>]\n";
+"Usage: $Name [-v] -H <host> -C <snmp_community> [-2] | (-l login -x passwd [-X pass -L <authp>,<privp>]) [-p <port>] [-P <protocol>] -m <name in desc_oid> [-q storagetype] -w <warn_level> -c <crit_level> [-t <timeout>] [-T pl|pu|bl|bu ] [-r -s -i -G] [-e] [-O] [-S 0|1[,1,<car>]] [-o <octet_length>] [-R <% reserved>]\n";
}
sub round ($$) {
@@ -180,6 +181,8 @@ sub help {
-e, --exclude
Select all storages except the one(s) selected by -m
No action on storage type selection
+-O, --okifempty
+ Consider OK instead of UNKNOWN if no storage found with given criteria
-T, --type=TYPE
pl : calculate percent left
pu : calculate percent used (Default)
@@ -279,6 +282,8 @@ sub check_options {
'index' => \$o_index,
'e' => \$o_negate,
'exclude' => \$o_negate,
+ 'O' => \$o_okifempty,
+ 'okifempty' => \$o_okifempty,
'V' => \$o_version,
'version' => \$o_version,
'q:s' => \$o_storagetype,
@@ -590,7 +595,10 @@ sub check_options {
}
}
verb("storages selected : $num_int");
-if ($num_int == 0) { print "Unknown storage : $o_descr : ERROR\n"; exit $ERRORS{"UNKNOWN"}; }
+if ($num_int == 0) {
+ if ($o_okifempty) { print "No storage found matching given criteria, but future new disks will be monitored\n"; exit $ERRORS{"OK"}; }
+ else { print "Unknown storage : $o_descr : ERROR\n"; exit $ERRORS{"UNKNOWN"}; }
+}
my $result = undef;

View file

@ -1,41 +0,0 @@
From effd196f76c4f4e9505b0955b020f8f65f1700a2 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Pawe=C5=82=20Szafer?= <pszafer@gmail.com>
Date: Mon, 16 Mar 2020 18:41:49 +0100
Subject: [PATCH] fix perf_out not defined error
---
plugins/check_snmp_int.pl | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
--- a/plugins/check_snmp_int.pl
+++ b/plugins/check_snmp_int.pl
@@ -1053,24 +1053,25 @@
# Check if all interface are OK
if ($num_ok == $num_int) {
+ my $is_perf_defined = defined($perf_out) && defined($o_perf);
if ($final_status == 0) {
print $print_out, ":", $num_ok, " UP: OK";
- if (defined($o_perf)) { print " | ", $perf_out; }
+ if ($is_perf_defined) { print " | ", $perf_out; }
print "\n";
exit $ERRORS{"OK"};
} elsif ($final_status == 1) {
print $print_out, ":(", $num_ok, " UP): WARNING";
- if (defined($o_perf)) { print " | ", $perf_out; }
+ if ($is_perf_defined) { print " | ", $perf_out; }
print "\n";
exit $ERRORS{"WARNING"};
} elsif ($final_status == 2) {
print $print_out, ":(", $num_ok, " UP): CRITICAL";
- if (defined($o_perf)) { print " | ", $perf_out; }
+ if ($is_perf_defined) { print " | ", $perf_out; }
print "\n";
exit $ERRORS{"CRITICAL"};
} else {
print $print_out, ":(", $num_ok, " UP): UNKNOWN";
- if (defined($perf_out)) { print " | ", $perf_out; }
+ if ($is_perf_defined) { print " | ", $perf_out; }
print "\n";
exit $ERRORS{"UNKNOWN"};
}

View file

@ -1,23 +0,0 @@
From 524e0eec7407bb0f650e28aa3d26e16028b86e54 Mon Sep 17 00:00:00 2001
From: Steffen Schoch <dein@gehirn-mag.net>
Date: Tue, 27 Apr 2021 06:14:34 +0200
Subject: [PATCH] Update check_snmp_int.pl
Removed unneeded my
---
plugins/check_snmp_int.pl | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/plugins/check_snmp_int.pl b/plugins/check_snmp_int.pl
index 5fe752e..271cfbc 100755
--- a/plugins/check_snmp_int.pl
+++ b/plugins/check_snmp_int.pl
@@ -1038,7 +1038,7 @@ sub check_options {
$perf_out .= "'" . $descr[$i] =~ s/\./_/r . "_out_discard'=" . $$result{ $oid_perf_outdisc[$i] } . "c ";
}
if (defined($o_perfs)) {
- my $speed_real = "" unless (defined($speed_real));
+ $speed_real = "" unless (defined($speed_real));
$perf_out .= "'" . $descr[$i] =~ s/\./_/r . "_speed_bps'=" . $speed_real . " ";
}
if (defined($o_weather) && $usable_data == 1) {

View file

@ -1,93 +0,0 @@
From c591f7d56378cbb40f1c3c23cbf23a8669a45730 Mon Sep 17 00:00:00 2001
From: kwork-er <88452982+kwork-er@users.noreply.github.com>
Date: Thu, 5 Aug 2021 21:53:43 +0200
Subject: [PATCH] Update check_snmp_int.pl
Effectively reverting commit 9f9b15a926d8795935b54626dc3ab9e5becb2763 and doing it in a different way that avoids adding huge amounts of regex, that may not run on older systems.
Removed the added " =~ s/\./_/r ", instead replacing the dots (.) in the regex that was meant for it in the first place -> line 967.
---
plugins/check_snmp_int.pl | 28 ++++++++++++++--------------
1 file changed, 14 insertions(+), 14 deletions(-)
diff --git a/plugins/check_snmp_int.pl b/plugins/check_snmp_int.pl
index 271cfbc..71f8d14 100755
--- a/plugins/check_snmp_int.pl
+++ b/plugins/check_snmp_int.pl
@@ -964,7 +964,7 @@ sub check_options {
}
# Get rid of special caracters for performance in description
- $descr[$i] =~ s/'\/\(\)/_/g;
+ $descr[$i] =~ s/['\/\(\).]/_/g;
if (($int_status == $ok_val) || (defined($o_down) && $int_status == 2) || (defined($o_dormant) && $int_status == 5))
{
$num_ok++;
@@ -979,12 +979,12 @@ sub check_options {
$warn_factor /= $speed_real;
$warn_factor *= 100; # now turn into displayed % : 0,1 = 10%
}
- $perf_out .= "'" . $descr[$i] =~ s/\./_/r . "_in_prct'=";
+ $perf_out .= "'" . $descr[$i] . "_in_prct'=";
$perf_out .= sprintf("%.0f", $checkperf_out_raw[0] * 800 / $speed_real) . "%;";
$perf_out .= ($o_warn[0] != 0) ? sprintf("%.0f", $o_warn[0] * $warn_factor) . ";" : ";";
$perf_out .= ($o_crit[0] != 0) ? sprintf("%.0f", $o_crit[0] * $warn_factor) . ";" : ";";
$perf_out .= "0;100 ";
- $perf_out .= "'" . $descr[$i] =~ s/\./_/r . "_out_prct'=";
+ $perf_out .= "'" . $descr[$i] . "_out_prct'=";
$perf_out .= sprintf("%.0f", $checkperf_out_raw[1] * 800 / $speed_real) . "%;";
$perf_out .= ($o_warn[1] != 0) ? sprintf("%.0f", $o_warn[1] * $warn_factor) . ";" : ";";
$perf_out .= ($o_crit[1] != 0) ? sprintf("%.0f", $o_crit[1] * $warn_factor) . ";" : ";";
@@ -1000,12 +1000,12 @@ sub check_options {
} else { # just convert from K|M|G bps
$warn_factor = (defined($o_meg)) ? 1000000 : (defined($o_gig)) ? 1000000000 : 1000;
}
- $perf_out .= "'" . $descr[$i] =~ s/\./_/r . "_in_bps'=";
+ $perf_out .= "'" . $descr[$i] . "_in_bps'=";
$perf_out .= sprintf("%.0f", $checkperf_out_raw[0] * 8) . ";";
$perf_out .= ($o_warn[0] != 0) ? $o_warn[0] * $warn_factor . ";" : ";";
$perf_out .= ($o_crit[0] != 0) ? $o_crit[0] * $warn_factor . ";" : ";";
$perf_out .= "0;" . $speed_real . " ";
- $perf_out .= "'" . $descr[$i] =~ s/\./_/r . "_out_bps'=";
+ $perf_out .= "'" . $descr[$i] . "_out_bps'=";
$perf_out .= sprintf("%.0f", $checkperf_out_raw[1] * 8) . ";";
$perf_out .= ($o_warn[1] != 0) ? $o_warn[1] * $warn_factor . ";" : ";";
$perf_out .= ($o_crit[1] != 0) ? $o_crit[1] * $warn_factor . ";" : ";";
@@ -1017,29 +1017,29 @@ sub check_options {
} else { # just convert from K|M|G bps
$warn_factor = (defined($o_meg)) ? 1048576 : (defined($o_gig)) ? 1073741824 : 1024;
}
- $perf_out .= "'" . $descr[$i] =~ s/\./_/r . "_in_Bps'=" . sprintf("%.0f", $checkperf_out_raw[0]) . ";";
+ $perf_out .= "'" . $descr[$i] . "_in_Bps'=" . sprintf("%.0f", $checkperf_out_raw[0]) . ";";
$perf_out .= ($o_warn[0] != 0) ? $o_warn[0] * $warn_factor . ";" : ";";
$perf_out .= ($o_crit[0] != 0) ? $o_crit[0] * $warn_factor . ";" : ";";
$perf_out .= "0;" . $speed_real / 8 . " ";
- $perf_out .= "'" . $descr[$i] =~ s/\./_/r . "_out_Bps'=" . sprintf("%.0f", $checkperf_out_raw[1]) . ";";
+ $perf_out .= "'" . $descr[$i] . "_out_Bps'=" . sprintf("%.0f", $checkperf_out_raw[1]) . ";";
$perf_out .= ($o_warn[1] != 0) ? $o_warn[1] * $warn_factor . ";" : ";";
$perf_out .= ($o_crit[1] != 0) ? $o_crit[1] * $warn_factor . ";" : ";";
$perf_out .= "0;" . $speed_real / 8 . " ";
}
}
} else { # output in octet counter
- $perf_out .= "'" . $descr[$i] =~ s/\./_/r . "_in_octet'=" . $$result{ $oid_perf_inoct[$i] } . "c ";
- $perf_out .= "'" . $descr[$i] =~ s/\./_/r . "_out_octet'=" . $$result{ $oid_perf_outoct[$i] } . "c ";
+ $perf_out .= "'" . $descr[$i] . "_in_octet'=" . $$result{ $oid_perf_inoct[$i] } . "c ";
+ $perf_out .= "'" . $descr[$i] . "_out_octet'=" . $$result{ $oid_perf_outoct[$i] } . "c ";
}
if (defined($o_perfe)) {
- $perf_out .= "'" . $descr[$i] =~ s/\./_/r . "_in_error'=" . $$result{ $oid_perf_inerr[$i] } . "c ";
- $perf_out .= "'" . $descr[$i] =~ s/\./_/r . "_in_discard'=" . $$result{ $oid_perf_indisc[$i] } . "c ";
- $perf_out .= "'" . $descr[$i] =~ s/\./_/r . "_out_error'=" . $$result{ $oid_perf_outerr[$i] } . "c ";
- $perf_out .= "'" . $descr[$i] =~ s/\./_/r . "_out_discard'=" . $$result{ $oid_perf_outdisc[$i] } . "c ";
+ $perf_out .= "'" . $descr[$i] . "_in_error'=" . $$result{ $oid_perf_inerr[$i] } . "c ";
+ $perf_out .= "'" . $descr[$i] . "_in_discard'=" . $$result{ $oid_perf_indisc[$i] } . "c ";
+ $perf_out .= "'" . $descr[$i] . "_out_error'=" . $$result{ $oid_perf_outerr[$i] } . "c ";
+ $perf_out .= "'" . $descr[$i] . "_out_discard'=" . $$result{ $oid_perf_outdisc[$i] } . "c ";
}
if (defined($o_perfs)) {
$speed_real = "" unless (defined($speed_real));
- $perf_out .= "'" . $descr[$i] =~ s/\./_/r . "_speed_bps'=" . $speed_real . " ";
+ $perf_out .= "'" . $descr[$i] . "_speed_bps'=" . $speed_real . " ";
}
if (defined($o_weather) && $usable_data == 1) {
$perf_out .= "in=" . sprintf("%.0f", $checkperf_out_raw[0]) . ";;;0;" . sprintf("%.0f", $speed_real / 8) . " ";

View file

@ -1,90 +0,0 @@
From 946bd37f5632fead9382f05a3600f0328dae53a1 Mon Sep 17 00:00:00 2001
From: Martin Botka <16738302+Haxk20@users.noreply.github.com>
Date: Mon, 1 Aug 2022 12:14:37 +0200
Subject: [PATCH] check_snmp_load.pl: Add Fortiswitch & 4.3+ firmware fortigate
This commit adds support for checking the fortiswitch CPU usage
and also fortigate 4.3 and above firmware. This OID got changed but to keep
backwards compatibility and not to break already running platforms depending on this
the new OID was added as new type.
Signed-off-by: Martin Botka <martin.botka@somainline.org>
---
plugins/check_snmp_load.pl | 21 ++++++++++++++-------
1 file changed, 14 insertions(+), 7 deletions(-)
diff --git a/plugins/check_snmp_load.pl b/plugins/check_snmp_load.pl
index 0959f6a..ecafb59 100755
--- a/plugins/check_snmp_load.pl
+++ b/plugins/check_snmp_load.pl
@@ -81,6 +81,12 @@
# Fortigate CPU
my $fortigate_cpu = ".1.3.6.1.4.1.12356.1.8.0"; # Fortigate CPU % usage
+# Fortigate CPU
+my $fortigate43_cpu = "1.3.6.1.4.1.12356.101.4.1.3.0"; # Fortigate 4.3 firmware CPU % usage
+
+# Fortigate CPU
+my $fortiswitch_cpu = ".1.3.6.1.4.1.12356.106.4.1.2.0"; # Fortiswitch CPU % usage
+
# Linkproof Appliance
my $linkproof_cpu = "1.3.6.1.4.1.89.35.1.55.0"; # CPU RE (Routing Engine Tasks)
@@ -95,12 +101,12 @@
# valid values
my @valid_types
- = ("stand", "netsc", "netsl", "as400", "cisco", "cata", "cisg", "nsc", "fg", "bc", "nokia", "hp", "lp", "hpux", "n5k");
+ = ("stand", "netsc", "netsl", "as400", "cisco", "cata", "cisg", "nsc", "fg", "fg43", "fs", "bc", "nokia", "hp", "lp", "hpux", "n5k");
# CPU OID array
my %cpu_oid = (
"netsc", $ns_cpu_idle, "as400", $as400_cpu, "bc", $bluecoat_cpu, "nokia", $nokia_cpu,
- "hp", $procurve_cpu, "lp", $linkproof_cpu, "fg", $fortigate_cpu, "n5k", $n5k_cpu
+ "hp", $procurve_cpu, "lp", $linkproof_cpu, "fg", $fortigate_cpu, "fg43", $fortigate43_cpu, "fs", $fortiswitch_cpu, "n5k", $n5k_cpu
);
# Globals
@@ -113,7 +119,7 @@
my $o_verb = undef; # verbose mode
my $o_version = undef; # print version
-# check type : stand | netsc | netsl | as400 | cisco | cata | cisg | nsc | fg | bc | nokia | hp | lp | hpux
+# check type : stand | netsc | netsl | as400 | cisco | cata | cisg | nsc | fg | fg43| fs | bc | nokia | hp | lp | hpux
my $o_check_type = "stand";
# End compatibility
@@ -139,7 +145,7 @@
sub print_usage {
print
-"Usage: $0 [-v] -H <host> -C <snmp_community> [-2] | (-l login -x passwd [-X pass -L <authp>,<privp>]) [-p <port>] [-P <protocol>] -w <warn level> -c <crit level> -T=[stand|netsl|netsc|as400|cisco|cata|cisg|nsc|fg|bc|nokia|hp|lp|hpux] [-f] [-t <timeout>] [-V]\n";
+"Usage: $0 [-v] -H <host> -C <snmp_community> [-2] | (-l login -x passwd [-X pass -L <authp>,<privp>]) [-p <port>] [-P <protocol>] -w <warn level> -c <crit level> -T=[stand|netsl|netsc|as400|cisco|cata|cisg|nsc|fg|fg43|fs|bc|nokia|hp|lp|hpux] [-f] [-t <timeout>] [-V]\n";
}
sub isnnum { # Return true if arg is not a number
@@ -201,6 +207,8 @@ sub help {
cisg : Cisco small business (SG500) CPU usage (1,5 & 15 minutes values)
nsc : NetScreen CPU usage
fg : Fortigate CPU usage
+ fg43 : Fortigate CPU usage for 4.3 firmware
+ fs : Fortiswitch CPU usage
bc : Bluecoat CPU usage
nokia : Nokia CPU usage
hp : HP procurve switch CPU usage
@@ -806,8 +814,8 @@ sub is_legacy_snmp_version {
exit $exit_val;
}
-################## CPU for : AS/400 , Netsnmp, HP, Bluecoat, linkproof, fortigate ###########
-if ($o_check_type =~ /netsc|as400|bc|nokia|^hp$|lp|fg/) {
+################## CPU for : AS/400 , Netsnmp, HP, Bluecoat, linkproof, fortigate, fortigate43, fortiswitch ###########
+if ($o_check_type =~ /netsc|as400|bc|nokia|^hp$|lp|fg|fg43|fs/) {
# Get load table
my @oidlist = $cpu_oid{$o_check_type};
@@ -965,4 +973,3 @@ sub is_legacy_snmp_version {
? print " | cpu_prct_used=$cpu_used%;$o_warn;$o_crit\n"
: print "\n";
exit $exit_val;
-

View file

@ -1,423 +0,0 @@
From 42f4ebf23be504e448513a67faa99e02a3d5e3b5 Mon Sep 17 00:00:00 2001
From: IB Development Team <dev@ib.pl>
Date: Thu, 19 Jan 2023 10:36:45 +0000
Subject: [PATCH] No out of space check_snmp_storage warning on btrfs
We've noticed out of space condition in one of btrfs filesystems
monitored with check_snmp_storage; problem was not detected by
check_snmp_storage.
Filesystem status:
root@mysrv:~# btrfs fi df -b /mnt
Data, single: total=2222194688, used=2222194688
System, DUP: total=8388608, used=16384
System, single: total=4194304, used=0
Metadata, DUP: total=484835328, used=163921920
Metadata, single: total=8388608, used=0
GlobalReserve, single: total=16777216, used=0
root@mysrv:~# df -B1 /mnt
Filesystem 1B-blocks Used Available Use% Mounted on
/dev/mapper/myvg 3221225472 2566848512 0 100% /mnt
Net-snmp snmp infos for this fs:
hrStorageTable (used by check_snmp_storage):
iso.3.6.1.2.1.25.2.3.1.1.69 = INTEGER: 69 //
hrStorageIndex
iso.3.6.1.2.1.25.2.3.1.2.69 = OID: iso.3.6.1.2.1.25.2.1.4 //
hrStorageType
iso.3.6.1.2.1.25.2.3.1.3.69 = STRING: "/mnt" //
hrStorageDescr
iso.3.6.1.2.1.25.2.3.1.4.69 = INTEGER: 4096 //
hrStorageAllocationUnits
iso.3.6.1.2.1.25.2.3.1.5.69 = INTEGER: 786432 //
hrStorageSize
iso.3.6.1.2.1.25.2.3.1.6.69 = INTEGER: 626672 //
hrStorageUsed
dskTable (not used by check_snmp_storage):
iso.3.6.1.4.1.2021.9.1.1.19 = INTEGER:
19 // dskIndex
iso.3.6.1.4.1.2021.9.1.2.19 = STRING:
"/mnt" // dskPath
iso.3.6.1.4.1.2021.9.1.3.19 = STRING: "/dev/mapper/myvg" //
dskDevice
iso.3.6.1.4.1.2021.9.1.4.19 = INTEGER:
-1 // dskMinimum
iso.3.6.1.4.1.2021.9.1.5.19 = INTEGER:
10 // dskMinPercent
iso.3.6.1.4.1.2021.9.1.6.19 = INTEGER:
3145728 // dskTotal (Total size of the
disk/partion (kBytes))
iso.3.6.1.4.1.2021.9.1.7.19 = INTEGER:
0 // dskAvail (Available space on the
disk)
iso.3.6.1.4.1.2021.9.1.8.19 = INTEGER:
2506688 // dskUsed (Used space on the disk)
iso.3.6.1.4.1.2021.9.1.9.19 = INTEGER:
80 // dskPercent (Percentage of space
used on disk)
iso.3.6.1.4.1.2021.9.1.10.19 = INTEGER:
0 // dskPercentNode (Percentage of
inodes used on disk)
iso.3.6.1.4.1.2021.9.1.11.19 = Gauge32:
3145728 // dskTotalLow Total size of the
disk/partion (kBytes). Together with dskTotalHigh composes 64-bit
number)
iso.3.6.1.4.1.2021.9.1.12.19 = Gauge32:
0 // dskTotalHigh (Total size of the
disk/partion (kBytes). Together with dskTotalLow composes 64-bit
number.)
iso.3.6.1.4.1.2021.9.1.13.19 = Gauge32:
0 // dskAvailLow (Available space on
the disk (kBytes). Together with dskAvailHigh composes 64-bit number.)
iso.3.6.1.4.1.2021.9.1.14.19 = Gauge32:
0 // dskAvailHigh (Available space on
the disk (kBytes). Together with dskAvailLow composes 64-bit number.)
iso.3.6.1.4.1.2021.9.1.15.19 = Gauge32:
2506688 // dskUsedLow (Used space on the disk
(kBytes). Together with dskUsedHigh composes 64-bit number.)
iso.3.6.1.4.1.2021.9.1.16.19 = Gauge32:
0 // dskUsedHigh (Used space on the
disk (kBytes). Together with dskUsedLow composes 64-bit number.)
iso.3.6.1.4.1.2021.9.1.100.19 = INTEGER:
1 // dskErrorFlag (Error flag signaling
that the disk or partition is under the minimum required space
configured for it.)
iso.3.6.1.4.1.2021.9.1.101.19 = STRING: "/mnt: less than 10% free (=
0%)" // dskErrorMsg (A text description providing a warning and the
space left on the disk.)
The cause of problem is that in btrfs free space may be less than
total-used and by default check_snmp_storage checks used space which
was in this case about 80% (with 0% available in the same time and OS
was throwing OOS errors on write).
The solution is to configure warn/crit levels for %free not %used and
use avail from dskTable because hrStorageTable does not provide this
info (check_snmp_storage calculates free=total-used which is wrong for
btrfs as above).
This patch works ok for us (this allows one to use new -u switch to use
dskTable and its avail info instead of default hrStorageTable and its
free=total-used calculation). This also adds a few spaces to plugin
output for better message readability.
---
plugins/check_snmp_storage.pl | 145 ++++++++++++++++++++++++++--------
1 file changed, 110 insertions(+), 35 deletions(-)
--- a/plugins/check_snmp_storage.pl
+++ b/plugins/check_snmp_storage.pl
@@ -19,13 +19,21 @@
my %ERRORS = ('OK' => 0, 'WARNING' => 1, 'CRITICAL' => 2, 'UNKNOWN' => 3, 'DEPENDENT' => 4);
# SNMP Datas
-my $storage_table = '1.3.6.1.2.1.25.2.3.1';
-my $storagetype_table = '1.3.6.1.2.1.25.2.3.1.2';
-my $index_table = '1.3.6.1.2.1.25.2.3.1.1';
-my $descr_table = '1.3.6.1.2.1.25.2.3.1.3';
-my $size_table = '1.3.6.1.2.1.25.2.3.1.5.';
-my $used_table = '1.3.6.1.2.1.25.2.3.1.6.';
-my $alloc_units = '1.3.6.1.2.1.25.2.3.1.4.';
+
+my $hrStorageTable_storage_table = '1.3.6.1.2.1.25.2.3.1';
+my $hrStorageTable_storagetype_table = '1.3.6.1.2.1.25.2.3.1.2';
+my $hrStorageTable_index_table = '1.3.6.1.2.1.25.2.3.1.1';
+my $hrStorageTable_descr_table = '1.3.6.1.2.1.25.2.3.1.3';
+my $hrStorageTable_size_table = '1.3.6.1.2.1.25.2.3.1.5.';
+my $hrStorageTable_used_table = '1.3.6.1.2.1.25.2.3.1.6.';
+my $hrStorageTable_alloc_units = '1.3.6.1.2.1.25.2.3.1.4.';
+
+my $dskTable_storage_table = '1.3.6.1.4.1.2021.9.1';
+my $dskTable_index_table = '1.3.6.1.4.1.2021.9.1.1';
+my $dskTable_descr_table = '1.3.6.1.4.1.2021.9.1.2';
+my $dskTable_size_table = '1.3.6.1.4.1.2021.9.1.6.';
+my $dskTable_avail_table = '1.3.6.1.4.1.2021.9.1.7.';
+my $dskTable_used_table = '1.3.6.1.4.1.2021.9.1.8.';
#Storage types definition - from /usr/share/snmp/mibs/HOST-RESOURCES-TYPES.txt
my %hrStorage;
@@ -80,6 +88,8 @@
my @o_shortL = undef; # output type,where,cut
my $o_reserve = 0; # % reserved blocks (A. Greiner-B\ufffdr patch)
my $o_giga = undef; # output and levels in gigabytes instead of megabytes
+my $o_dsktable = undef; # use dskTable instead of default hrStorageTable
+
# SNMPv3 specific
my $o_login = undef; # Login for snmpv3
@@ -99,7 +109,7 @@
sub print_usage {
print
-"Usage: $Name [-v] -H <host> -C <snmp_community> [-2] | (-l login -x passwd [-X pass -L <authp>,<privp>]) [-p <port>] [-P <protocol>] -m <name in desc_oid> [-q storagetype] -w <warn_level> -c <crit_level> [-t <timeout>] [-T pl|pu|bl|bu ] [-r -s -i -G] [-e] [-O] [-S 0|1[,1,<car>]] [-o <octet_length>] [-R <% reserved>]\n";
+"Usage: $Name [-v] -H <host> -C <snmp_community> [-2] | (-l login -x passwd [-X pass -L <authp>,<privp>]) [-p <port>] [-P <protocol>] [-u] -m <name in desc_oid> [-q storagetype] -w <warn_level> -c <crit_level> [-t <timeout>] [-T pl|pu|bl|bu ] [-r -s -i -G] [-e] [-O] [-S 0|1[,1,<car>]] [-o <octet_length>] [-R <% reserved>]\n";
}
sub round ($$) {
@@ -145,13 +155,13 @@
-2, --v2c
Use snmp v2c
-l, --login=LOGIN ; -x, --passwd=PASSWD
- Login and auth password for snmpv3 authentication
- If no priv password exists, implies AuthNoPriv
+ Login and auth password for snmpv3 authentication
+ If no priv password exists, implies AuthNoPriv
-X, --privpass=PASSWD
Priv password for snmpv3 (AuthPriv protocol)
-L, --protocols=<authproto>,<privproto>
<authproto> : Authentication protocol (md5|sha : default md5)
- <privproto> : Priv protocole (des|aes : default des)
+ <privproto> : Priv protocole (des|aes : default des)
-x, --passwd=PASSWD
Password for snmpv3 authentication
-p, --port=PORT
@@ -162,6 +172,8 @@
'udp/ipv6' : UDP over IPv6
'tcp/ipv4' : TCP over IPv4
'tcp/ipv6' : TCP over IPv6
+-u, --dsktable
+ use dskTable instead of default hrStorageTable; cannot be used with -q
-m, --name=NAME
Name in description OID (can be mounpoints '/home' or 'Swap Space'...)
This is treated as a regexp : -m /var will match /var , /var/log, /opt/var ...
@@ -190,10 +202,10 @@
bu : calculate MegaBytes used
-w, --warn=INTEGER
percent / MB of disk used to generate WARNING state
- you can add the % sign
+ you can add the % sign
-c, --critical=INTEGER
percent / MB of disk used to generate CRITICAL state
- you can add the % sign
+ you can add the % sign
-R, --reserved=INTEGER
% reserved blocks for superuser
For ext2/3 filesystems, it is 5% by default
@@ -205,29 +217,29 @@
<type>: Make the output shorter :
0 : only print the global result except the disk in warning or critical
ex: "< 80% : OK"
- 1 : Don't print all info for every disk
+ 1 : Don't print all info for every disk
ex : "/ : 66 %used (< 80) : OK"
<where>: (optional) if = 1, put the OK/WARN/CRIT at the beginning
<cut>: take the <n> first caracters or <n> last if n<0
-o, --octetlength=INTEGER
max-size of the SNMP message, usefull in case of Too Long responses.
Be carefull with network filters. Range 484 - 65535, default are
- usually 1472,1452,1460 or 1440.
+ usually 1472,1452,1460 or 1440.
-t, --timeout=INTEGER
timeout for SNMP in seconds (Default: 5)
-V, --version
prints version number
-Note :
+Note :
with T=pu or T=bu : OK < warn < crit
with T=pl ot T=bl : crit < warn < OK
-
+
If multiple storage are selected, the worse condition will be returned
i.e if one disk is critical, the return is critical
-
- example :
- Browse storage list : <script> -C <community> -H <host> -m <anything> -w 1 -c 2 -v
- the -m option allows regexp in perl format :
- Test drive C,F,G,H,I on Windows : -m ^[CFGHI]:
+
+ example :
+ Browse storage list : <script> -C <community> -H <host> -m <anything> -w 1 -c 2 -v
+ the -m option allows regexp in perl format :
+ Test drive C,F,G,H,I on Windows : -m ^[CFGHI]:
Test all mounts containing /var : -m /var
Test all mounts under /var : -m ^/var
Test only /var : -m /var -r
@@ -270,6 +282,8 @@
'warn:s' => \$o_warn,
't:i' => \$o_timeout,
'timeout:i' => \$o_timeout,
+ 'u' => \$o_dsktable,
+ 'dsktable64' => \$o_dsktable,
'm:s' => \$o_descr,
'name:s' => \$o_descr,
'T:s' => \$o_type,
@@ -404,6 +418,14 @@
print_usage();
exit $ERRORS{"UNKNOWN"};
}
+
+ # disallow using -u and -q together
+ if (defined($o_dsktable) && defined($o_storagetype)) {
+ print "Parameters -u and -q cannot be used together!\n";
+ print_usage();
+ exit $ERRORS{"UNKNOWN"}
+ }
+
}
########## MAIN #######
@@ -507,6 +529,30 @@
my $resultat = undef;
my $stype = undef;
+my $storage_table;
+my $index_table;
+my $descr_table;
+my $size_table;
+my $used_table;
+my $alloc_units;
+
+if (defined($o_dsktable)) {
+ $storage_table = $dskTable_storage_table;
+ $index_table = $dskTable_index_table;
+ $descr_table = $dskTable_descr_table;
+ $size_table = $dskTable_size_table;
+ $used_table = $dskTable_used_table;
+ $alloc_units = 'dummy';
+}
+else {
+ $storage_table = $hrStorageTable_storage_table;
+ $index_table = $hrStorageTable_index_table;
+ $descr_table = $hrStorageTable_descr_table;
+ $size_table = $hrStorageTable_size_table;
+ $used_table = $hrStorageTable_used_table;
+ $alloc_units = $hrStorageTable_alloc_units;
+}
+
# Get rid of UTF8 translation in case of accentuated caracters (thanks to Dimo Velev).
$session->translate(Net::SNMP->TRANSLATE_NONE);
if (defined($o_index)) {
@@ -526,9 +572,9 @@
#get storage typetable for reference
if (defined($o_storagetype)) {
if (version->parse(Net::SNMP->VERSION) < 4) {
- $stype = $session->get_table($storagetype_table);
+ $stype = $session->get_table($hrStorageTable_storagetype_table);
} else {
- $stype = $session->get_table(Baseoid => $storagetype_table);
+ $stype = $session->get_table(Baseoid => $hrStorageTable_storagetype_table);
}
}
if (!defined($resultat) | (!defined($stype) && defined($o_storagetype))) {
@@ -573,7 +619,7 @@
# Check if storage type is OK
if (defined($o_storagetype)) {
- my ($skey) = $storagetype_table . "." . $tindex[$num_int];
+ my ($skey) = $hrStorageTable_storagetype_table . "." . $tindex[$num_int];
verb(" OID : $skey, Storagetype: $hrStorage{$$stype{$skey}} ?= $o_storagetype");
if ($hrStorage{ $$stype{$skey} } !~ $o_storagetype) {
$test = undef;
@@ -587,7 +633,12 @@
# put the oid in an array
$oids[$count_oid++] = $size_table . $tindex[$num_int];
$oids[$count_oid++] = $used_table . $tindex[$num_int];
- $oids[$count_oid++] = $alloc_units . $tindex[$num_int];
+ if (!defined($o_dsktable)) {
+ $oids[$count_oid++] = $alloc_units . $tindex[$num_int];
+ }
+ else {
+ $oids[$count_oid++] = $dskTable_avail_table . $tindex[$num_int];
+ }
verb(" Name : $descr[$num_int], Index : $tindex[$num_int]");
$num_int++;
@@ -635,9 +686,17 @@
# Only a few ms left...
alarm(0);
+# dskTable use fixed 1kB unit
+if (defined($o_dsktable)) {
+ for (my $i = 0; $i < $num_int; $i++) {
+ $$result{ $alloc_units . $tindex[$i] } = 1024;
+ }
+}
+
# Sum everything if -s and more than one storage
if (defined($o_sum) && ($num_int > 1)) {
verb("Adding all entries");
+
$$result{ $size_table . $tindex[0] } *= $$result{ $alloc_units . $tindex[0] };
$$result{ $used_table . $tindex[0] } *= $$result{ $alloc_units . $tindex[0] };
$$result{ $alloc_units . $tindex[0] } = 1;
@@ -670,6 +729,9 @@
verb("Size : $$result{$size_table . $tindex[$i]}");
verb("Used : $$result{$used_table . $tindex[$i]}");
verb("Alloc : $$result{$alloc_units . $tindex[$i]}");
+ if (defined($o_dsktable)) {
+ verb("Avail : $$result{$dskTable_avail_table . $tindex[$i]}");
+ }
if ( !defined($$result{ $size_table . $tindex[$i] })
|| !defined($$result{ $used_table . $tindex[$i] })
@@ -691,12 +753,24 @@
$pu = 0;
}
my $bu = $$result{ $used_table . $tindex[$i] } * $$result{ $alloc_units . $tindex[$i] } / $output_metric_val;
- my $pl = 100 - $pu;
- my $bl
- = (
- ($$result{ $size_table . $tindex[$i] } * ((100 - $o_reserve) / 100) - ($$result{ $used_table . $tindex[$i] }))
- * $$result{ $alloc_units . $tindex[$i] }
+
+ # in dskTable mode get available storage from SNMP to avoid problems with filesystems like btrfs
+ # where available may be 0 but size-used is still > 0
+ my $pl;
+ my $bl;
+ if (defined($o_dsktable)) {
+ $pl = $$result{ $dskTable_avail_table . $tindex[$i] } * 100
+ / ($$result{ $size_table . $tindex[$i] } * (100 - $o_reserve) / 100);
+ $bl = $$result{ $dskTable_avail_table . $tindex[$i] } * $$result{ $alloc_units . $tindex[$i] }
+ / $output_metric_val;
+ }
+ else {
+ $pl = 100 - $pu;
+ $bl = (
+ ($$result{ $size_table . $tindex[$i] } * ((100 - $o_reserve) / 100) - ($$result{ $used_table . $tindex[$i] }))
+ * $$result{ $alloc_units . $tindex[$i] }
/ $output_metric_val);
+ }
# add a ' ' if some data exists in $perf_out
$perf_out .= " " if (defined($perf_out));
@@ -717,7 +791,7 @@
|| (($pu >= $o_warn) && ($locstate = $warn_state = 1));
if (defined($o_shortL[2])) { }
if (!defined($o_shortL[0]) || ($locstate == 1)) { # print full output if warn or critical state
- $output .= sprintf("%s: %.0f%%used(%.0f%sB/%.0f%sB) ", $descr[$i], $pu, $bu, $output_metric, $to,
+ $output .= sprintf("%s: %.0f%% used (%.0f%sB/%.0f%sB) ", $descr[$i], $pu, $bu, $output_metric, $to,
$output_metric);
} elsif ($o_shortL[0] == 1) {
$output .= sprintf("%s: %.0f%% ", $descr[$i], $pu);
@@ -732,7 +806,7 @@
|| (($bu >= $o_warn) && ($locstate = $warn_state = 1));
if (!defined($o_shortL[0]) || ($locstate == 1)) { # print full output if warn or critical state
$output
- .= sprintf("%s: %.0f%sBused/%.0f%sB (%.0f%%) ", $descr[$i], $bu, $output_metric, $to, $output_metric,
+ .= sprintf("%s: %.0f%sB used / %.0f%sB (%.0f%%) ", $descr[$i], $bu, $output_metric, $to, $output_metric,
$pu);
} elsif ($o_shortL[0] == 1) {
$output .= sprintf("%s: %.0f%sB ", $descr[$i], $bu, $output_metric);
@@ -747,7 +821,7 @@
|| (($bl <= $o_warn) && ($locstate = $warn_state = 1));
if (!defined($o_shortL[0]) || ($locstate == 1)) { # print full output if warn or critical state
$output
- .= sprintf("%s: %.0f%sBleft/%.0f%sB (%.0f%%) ", $descr[$i], $bl, $output_metric, $to, $output_metric,
+ .= sprintf("%s: %.0f%sB left / %.0f%sB (%.0f%%) ", $descr[$i], $bl, $output_metric, $to, $output_metric,
$pl);
} elsif ($o_shortL[0] == 1) {
$output .= sprintf("%s: %.0f%sB ", $descr[$i], $bl, $output_metric);
@@ -761,7 +835,7 @@
(($pl <= $o_crit) && ($locstate = $crit_state = 1))
|| (($pl <= $o_warn) && ($locstate = $warn_state = 1));
if (!defined($o_shortL[0]) || ($locstate == 1)) { # print full output if warn or critical state
- $output .= sprintf("%s: %.0f%%left(%.0f%sB/%.0f%sB) ", $descr[$i], $pl, $bl, $output_metric, $to,
+ $output .= sprintf("%s: %.0f%% left (%.0f%sB/%.0f%sB) ", $descr[$i], $pl, $bl, $output_metric, $to,
$output_metric);
} elsif ($o_shortL[0] == 1) {
$output .= sprintf("%s: %.0f%% ", $descr[$i], $pl);

View file

@ -1,116 +0,0 @@
## 50_disable_epn by Jan Wagner <waja@cyconet.org>
##
## DP: leave marks to disable epn
--- a/plugins/check_snmp_boostedge.pl
+++ b/plugins/check_snmp_boostedge.pl
@@ -1,4 +1,5 @@
#!/usr/bin/perl -w
+# nagios: -epn
############################## check_snmp_boostedge.pl #################
# Version : 1.0
# Date : Jan 16 2007
--- a/plugins/check_snmp_cpfw.pl
+++ b/plugins/check_snmp_cpfw.pl
@@ -1,4 +1,5 @@
#!/usr/bin/perl -w
+# nagios: -epn
############################## check_snmp_cpfw ##############
my $VERSION = "2.1.0";
--- a/plugins/check_snmp_css_main.pl
+++ b/plugins/check_snmp_css_main.pl
@@ -1,4 +1,5 @@
#!/usr/bin/perl -w
+# nagios: -epn
############################## check_snmp_css_main.pl #################
# Version : 1.0
# Date : 27 Sept 2006
--- a/plugins/check_snmp_css.pl
+++ b/plugins/check_snmp_css.pl
@@ -1,4 +1,5 @@
#!/usr/bin/perl -w
+# nagios: -epn
############################## check_snmp_css.pl #################
# Version : 1.0.1
# Date : 27 Sept 2006
--- a/plugins/check_snmp_env.pl
+++ b/plugins/check_snmp_env.pl
@@ -1,4 +1,5 @@
#!/usr/bin/perl -w
+# nagios: -epn
############################## check_snmp_env #################
# Version : 1.3
# Date : May 24 2007
--- a/plugins/check_snmp_int.pl
+++ b/plugins/check_snmp_int.pl
@@ -1,4 +1,5 @@
#!/usr/bin/perl -w
+# nagios: -epn
############################## check_snmp_int ##############
my $VERSION = "2.1.0";
--- a/plugins/check_snmp_linkproof_nhr.pl
+++ b/plugins/check_snmp_linkproof_nhr.pl
@@ -1,4 +1,5 @@
#!/usr/bin/perl -w
+# nagios: -epn
############################## check_snmp_linkproof_nhr #################
# Version : 1.0
# Date : Aug 24 2006
--- a/plugins/check_snmp_load.pl
+++ b/plugins/check_snmp_load.pl
@@ -1,4 +1,5 @@
#!/usr/bin/perl -w
+# nagios: -epn
############################## check_snmp_load #################
my $VERSION = "2.1.0";
--- a/plugins/check_snmp_mem.pl
+++ b/plugins/check_snmp_mem.pl
@@ -1,4 +1,5 @@
#!/usr/bin/perl -w
+# nagios: -epn
############################## check_snmp_mem ##############
my $VERSION = "2.1.0";
--- a/plugins/check_snmp_nsbox.pl
+++ b/plugins/check_snmp_nsbox.pl
@@ -1,4 +1,5 @@
#!/usr/bin/perl -w
+# nagios: -epn
############################## check_snmp_nsbox #################
# Version : 1.0
# Date : Jan 16 2007
--- a/plugins/check_snmp_process.pl
+++ b/plugins/check_snmp_process.pl
@@ -1,4 +1,5 @@
#!/usr/bin/perl -w
+# nagios: -epn
############################## check_snmp_process ##############
my $VERSION = "2.1.0";
--- a/plugins/check_snmp_storage.pl
+++ b/plugins/check_snmp_storage.pl
@@ -1,4 +1,5 @@
#!/usr/bin/perl -w
+# nagios: -epn
############################## check_snmp_storage ##############
# Version : 1.3.3
# Date : Jun 1 2007
--- a/plugins/check_snmp_vrrp.pl
+++ b/plugins/check_snmp_vrrp.pl
@@ -1,4 +1,5 @@
#!/usr/bin/perl -w
+# nagios: -epn
############################## check_snmp_vrrp ##############
my $VERSION = "2.1.0";
--- a/plugins/check_snmp_win.pl
+++ b/plugins/check_snmp_win.pl
@@ -1,4 +1,5 @@
#!/usr/bin/perl -w
+# nagios: -epn
############################## check_snmp_win ##############
my $VERSION = "2.1.0";

View file

@ -1,394 +0,0 @@
## 51_fix_privacy_doc by Jan Wagner
##
## DP: Fixing potential privacy breach by fetching data from sourceforge.net
commit 084af86fe6ee55135144ac44f661ff139434fdc3
Author: Jan Wagner <waja@cyconet.org>
Date: Sun Mar 2 21:22:42 2014 +0100
Fix potential privacy breach of HTML documentation
--- a/doc/html/nagios.manubulon.com/faq.html
+++ b/doc/html/nagios.manubulon.com/faq.html
@@ -92,24 +92,13 @@
</tr>
<tr>
<td>
-<script type="text/javascript"><!--
-google_ad_client = "ca-pub-1303792821309694";
-/* nagios */
-google_ad_slot = "5986789334";
-google_ad_width = 120;
-google_ad_height = 600;
-//-->
-</script>
-<script type="text/javascript"
-src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
-</script>
</td>
</tr>
<tr>
<td><font color="#FFFFFF">-----------</font></td>
</tr>
<tr>
- <td><A href="http://sourceforge.net/projects/nagios-snmp"> <IMG src="http://sourceforge.net/sflogo.php?group_id=134917&amp;type=3" width="110" height="37" border="0" alt="SourceForge.net Logo" /></A> </td>
+ <td><A href="http://sourceforge.net/projects/nagios-snmp">http://sourceforge.net/projects/nagios-snmp</A> </td>
</tr>
</table>
<!-- End Side Bar -->
@@ -295,7 +284,7 @@
<td>
<p class="SectionBody">This project is also hosted by : <br>
- <A href="http://sourceforge.net/projects/nagios-snmp/"> <IMG src="http://sourceforge.net/sflogo.php?group_id=134917&type=5" width="210" height="62" border="0" alt="SourceForge.net Logo" /></A>
+ <A href="http://sourceforge.net/projects/nagios-snmp/">http://sourceforge.net/projects/nagios-snmp</A>
</p></td>
</tr>
--- a/doc/html/nagios.manubulon.com/index_commands.html
+++ b/doc/html/nagios.manubulon.com/index_commands.html
@@ -87,24 +87,13 @@
</tr>
<tr>
<td>
-<script type="text/javascript"><!--
-google_ad_client = "ca-pub-1303792821309694";
-/* nagios */
-google_ad_slot = "5986789334";
-google_ad_width = 120;
-google_ad_height = 600;
-//-->
-</script>
-<script type="text/javascript"
-src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
-</script>
</td>
</tr>
<tr>
<td><font color="#FFFFFF">-----------</font></td>
</tr>
<tr>
- <td><A href="http://sourceforge.net/projects/nagios-snmp"> <IMG src="http://sourceforge.net/sflogo.php?group_id=134917&amp;type=3" width="110" height="37" border="0" alt="SourceForge.net Logo" /></A> </td>
+ <td><A href="http://sourceforge.net/projects/nagios-snmp">http://sourceforge.net/projects/nagios-snmp</A> </td>
</tr>
</table>
<!-- End Side Bar -->
@@ -2004,7 +1993,7 @@
<p class="SectionBody">This project is hosted on : <br>
- <A href="http://sourceforge.net/projects/nagios-snmp"> <IMG src="http://sourceforge.net/sflogo.php?group_id=134917&type=5" width="210" height="62" border="0" alt="SourceForge.net Logo" /></A>
+ <A href="http://sourceforge.net/projects/nagios-snmp">http://sourceforge.net/projects/nagios-snmp</A>
</p>
--- a/doc/html/nagios.manubulon.com/snmp_cpfw.html
+++ b/doc/html/nagios.manubulon.com/snmp_cpfw.html
@@ -439,7 +439,7 @@
<p class="SectionBody">This project is hosted on : <br>
- <A href="http://sourceforge.net/projects/nagios-snmp"> <IMG src="http://sourceforge.net/sflogo.php?group_id=134917&type=5" width="210" height="62" border="0" alt="SourceForge.net Logo" /></A>
+ <A href="http://sourceforge.net/projects/nagios-snmp">http://sourceforge.net/projects/nagios-snmp</A>
</p>
--- a/doc/html/nagios.manubulon.com/snmp_css.html
+++ b/doc/html/nagios.manubulon.com/snmp_css.html
@@ -353,7 +353,7 @@
<p class="SectionBody">This project is hosted on : <br>
- <A href="http://sourceforge.net/projects/nagios-snmp"> <IMG src="http://sourceforge.net/sflogo.php?group_id=134917&type=5" width="210" height="62" border="0" alt="SourceForge.net Logo" /></A>
+ <A href="http://sourceforge.net/projects/nagios-snmp">http://sourceforge.net/projects/nagios-snmp</A>
</p>
--- a/doc/html/nagios.manubulon.com/snmp_env.html
+++ b/doc/html/nagios.manubulon.com/snmp_env.html
@@ -342,7 +342,7 @@
<p class="SectionBody">This project is hosted on : <br>
- <A href="http://sourceforge.net/projects/nagios-snmp"> <IMG src="http://sourceforge.net/sflogo.php?group_id=134917&type=5" width="210" height="62" border="0" alt="SourceForge.net Logo" /></A>
+ <A href="http://sourceforge.net/projects/nagios-snmp">http://sourceforge.net/projects/nagios-snmp</A>
</p>
--- a/doc/html/nagios.manubulon.com/snmp_int.html
+++ b/doc/html/nagios.manubulon.com/snmp_int.html
@@ -116,24 +116,13 @@
</tr>
<tr>
<td>
-<script type="text/javascript"><!--
-google_ad_client = "ca-pub-1303792821309694";
-/* nagios */
-google_ad_slot = "5986789334";
-google_ad_width = 120;
-google_ad_height = 600;
-//-->
-</script>
-<script type="text/javascript"
-src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
-</script>
</td>
</tr>
<tr>
<td><font color="#FFFFFF">-----------</font></td>
</tr>
<tr>
- <td><A href="http://sourceforge.net/projects/nagios-snmp"> <IMG src="http://sourceforge.net/sflogo.php?group_id=134917&amp;type=3" width="110" height="37" border="0" alt="SourceForge.net Logo" /></A> </td>
+ <td><A href="http://sourceforge.net/projects/nagios-snmp">http://sourceforge.net/projects/nagios-snmp</A> </td>
</tr>
</table>
<!-- End Side Bar -->
@@ -687,7 +676,7 @@
<p class="SectionBody">This project is hosted on : <br>
- <A href="http://sourceforge.net/projects/nagios-snmp"> <IMG src="http://sourceforge.net/sflogo.php?group_id=134917&type=5" width="210" height="62" border="0" alt="SourceForge.net Logo" /></A>
+ <A href="http://sourceforge.net/projects/nagios-snmp">http://sourceforge.net/projects/nagios-snmp</A>
</p>
--- a/doc/html/nagios.manubulon.com/snmp_load.html
+++ b/doc/html/nagios.manubulon.com/snmp_load.html
@@ -379,7 +379,7 @@
<p class="SectionBody">This project is hosted on : <br>
- <A href="http://sourceforge.net/projects/nagios-snmp"> <IMG src="http://sourceforge.net/sflogo.php?group_id=134917&type=5" width="210" height="62" border="0" alt="SourceForge.net Logo" /></A>
+ <A href="http://sourceforge.net/projects/nagios-snmp">http://sourceforge.net/projects/nagios-snmp</A>
</p>
--- a/doc/html/nagios.manubulon.com/snmp_mem.html
+++ b/doc/html/nagios.manubulon.com/snmp_mem.html
@@ -457,7 +457,7 @@
<p class="SectionBody">This project is hosted on : <br>
- <A href="http://sourceforge.net/projects/nagios-snmp"> <IMG src="http://sourceforge.net/sflogo.php?group_id=134917&type=5" width="210" height="62" border="0" alt="SourceForge.net Logo" /></A>
+ <A href="http://sourceforge.net/projects/nagios-snmp">http://sourceforge.net/projects/nagios-snmp</A>
</p>
--- a/doc/html/nagios.manubulon.com/snmp_process.html
+++ b/doc/html/nagios.manubulon.com/snmp_process.html
@@ -355,7 +355,7 @@
<tr>
<td>
<p class="SectionBody">This project is hosted on : <br>
- <A href="http://sourceforge.net/projects/nagios-snmp"> <IMG src="http://sourceforge.net/sflogo.php?group_id=134917&type=5" width="210" height="62" border="0" alt="SourceForge.net Logo" /></A>
+ <A href="http://sourceforge.net/projects/nagios-snmp">http://sourceforge.net/projects/nagios-snmp</A>
</p>
<p class="SectionBody"> Nagios and the Nagios logo are registered
trademarks of Ethan Galstad.</p>
--- a/doc/html/nagios.manubulon.com/snmp_storage.html
+++ b/doc/html/nagios.manubulon.com/snmp_storage.html
@@ -175,24 +175,13 @@
</tr>
<tr>
<td>
-<script type="text/javascript"><!--
-google_ad_client = "ca-pub-1303792821309694";
-/* nagios */
-google_ad_slot = "5986789334";
-google_ad_width = 120;
-google_ad_height = 600;
-//-->
-</script>
-<script type="text/javascript"
-src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
-</script>
</td>
</tr>
<tr>
<td><font color="#FFFFFF">-----------</font></td>
</tr>
<tr>
- <td><A href="http://sourceforge.net/projects/nagios-snmp"> <IMG src="http://sourceforge.net/sflogo.php?group_id=134917&amp;type=3" width="110" height="37" border="0" alt="SourceForge.net Logo" /></A> </td>
+ <td><A href="http://sourceforge.net/projects/nagios-snmp">http://sourceforge.net/projects/nagios-snmp</A> </td>
</tr>
</table>
<!-- End Side Bar -->
@@ -1278,7 +1267,7 @@
- <A href="http://sourceforge.net/projects/nagios-snmp"> <IMG src="http://sourceforge.net/sflogo.php?group_id=134917&type=5" width="210" height="62" border="0" alt="SourceForge.net Logo" /></A>
+ <A href="http://sourceforge.net/projects/nagios-snmp">http://sourceforge.net/projects/nagios-snmp</A>
--- a/doc/html/nagios.manubulon.com/snmp_vrrp.html
+++ b/doc/html/nagios.manubulon.com/snmp_vrrp.html
@@ -94,24 +94,13 @@
</tr>
<tr>
<td>
-<script type="text/javascript"><!--
-google_ad_client = "ca-pub-1303792821309694";
-/* nagios */
-google_ad_slot = "5986789334";
-google_ad_width = 120;
-google_ad_height = 600;
-//-->
-</script>
-<script type="text/javascript"
-src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
-</script>
</td>
</tr>
<tr>
<td><font color="#FFFFFF">-----------</font></td>
</tr>
<tr>
- <td><A href="http://sourceforge.net/projects/nagios-snmp"> <IMG src="http://sourceforge.net/sflogo.php?group_id=134917&amp;type=3" width="110" height="37" border="0" alt="SourceForge.net Logo" /></A> </td>
+ <td><A href="http://sourceforge.net/projects/nagios-snmp">http://sourceforge.net/projects/nagios-snmp</A> </td>
</tr>
</table>
<!-- End Side Bar -->
@@ -348,7 +337,7 @@
<p class="SectionBody">This project is hosted on : <br>
- <A href="http://sourceforge.net/projects/nagios-snmp"> <IMG src="http://sourceforge.net/sflogo.php?group_id=134917&type=5" width="210" height="62" border="0" alt="SourceForge.net Logo" /></A>
+ <A href="http://sourceforge.net/projects/nagios-snmp">http://sourceforge.net/projects/nagios-snmp</A>
</p>
--- a/doc/html/nagios.manubulon.com/snmp_windows.html
+++ b/doc/html/nagios.manubulon.com/snmp_windows.html
@@ -243,7 +243,7 @@
<tr>
<td>
<p class="SectionBody">This project is hosted on : <br>
- <A href="http://sourceforge.net/projects/nagios-snmp"> <IMG src="http://sourceforge.net/sflogo.php?group_id=134917&type=5" width="210" height="62" border="0" alt="SourceForge.net Logo" /></A>
+ <A href="http://sourceforge.net/projects/nagios-snmp">http://sourceforge.net/projects/nagios-snmp</A>
</p>
<p class="SectionBody"> Nagios and the Nagios logo are registered
trademarks of Ethan Galstad.</p>
--- a/doc/html/nagios.manubulon.com/index.html
+++ b/doc/html/nagios.manubulon.com/index.html
@@ -88,24 +88,13 @@
</tr>
<tr>
<td>
-<script type="text/javascript"><!--
-google_ad_client = "ca-pub-1303792821309694";
-/* nagios */
-google_ad_slot = "5986789334";
-google_ad_width = 120;
-google_ad_height = 600;
-//-->
-</script>
-<script type="text/javascript"
-src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
-</script>
</td>
</tr>
<tr>
<td><font color="#FFFFFF">-----------</font></td>
</tr>
<tr>
- <td><A href="http://sourceforge.net/projects/nagios-snmp"> <IMG src="http://sourceforge.net/sflogo.php?group_id=134917&amp;type=3" width="110" height="37" border="0" alt="SourceForge.net Logo" /></A> </td>
+ <td><A href="http://sourceforge.net/projects/nagios-snmp">http://sourceforge.net/projects/nagios-snmp</A> </td>
</tr>
</table>
<!-- End Side Bar -->
@@ -339,7 +328,7 @@
<tr>
<td><p class="SectionBody">All code here is under GPL licence. </p>
<p class="SectionBody">This project is hosted on : <br>
- <A href="http://sourceforge.net/projects/nagios-snmp"> <IMG src="http://sourceforge.net/sflogo.php?group_id=134917&type=5" width="210" height="62" border="0" alt="SourceForge.net Logo" /></A> </p></td>
+ <A href="http://sourceforge.net/projects/nagios-snmp">http://sourceforge.net/projects/nagios-snmp</p></td>
<td><p class="SectionBody"> Nagios and the Nagios logo are registered
trademarks of Ethan Galstad.</p></td>
</tr>
--- a/doc/html/nagios.manubulon.com/index_info.html
+++ b/doc/html/nagios.manubulon.com/index_info.html
@@ -86,24 +86,13 @@
</tr>
<tr>
<td>
-<script type="text/javascript"><!--
-google_ad_client = "ca-pub-1303792821309694";
-/* nagios */
-google_ad_slot = "5986789334";
-google_ad_width = 120;
-google_ad_height = 600;
-//-->
-</script>
-<script type="text/javascript"
-src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
-</script>
</td>
</tr>
<tr>
<td><font color="#FFFFFF">-----------</font></td>
</tr>
<tr>
- <td><A href="http://sourceforge.net/projects/nagios-snmp"> <IMG src="http://sourceforge.net/sflogo.php?group_id=134917&amp;type=3" width="110" height="37" border="0" alt="SourceForge.net Logo" /></A> </td>
+ <td><A href="http://sourceforge.net/projects/nagios-snmp">http://sourceforge.net/projects/nagios-snmp</A> </td>
</tr>
</table>
<!-- End Side Bar -->
@@ -588,7 +577,7 @@
<td>
<hr>
<p class="SectionBody">This project is hosted on : <br>
- <A href="http://sourceforge.net/projects/nagios-snmp"> <IMG src="http://sourceforge.net/sflogo.php?group_id=134917&type=5" width="210" height="62" border="0" alt="SourceForge.net Logo" /></A>
+ <A href="http://sourceforge.net/projects/nagios-snmp">http://sourceforge.net/projects/nagios-snmp</A>
</p>
<p class="SectionBody"> Nagios and the Nagios logo are registered
trademarks of Ethan Galstad.</p>
--- a/doc/html/nagios.manubulon.com/index_snmp.html
+++ b/doc/html/nagios.manubulon.com/index_snmp.html
@@ -86,24 +86,13 @@
</tr>
<tr>
<td>
-<script type="text/javascript"><!--
-google_ad_client = "ca-pub-1303792821309694";
-/* nagios */
-google_ad_slot = "5986789334";
-google_ad_width = 120;
-google_ad_height = 600;
-//-->
-</script>
-<script type="text/javascript"
-src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
-</script>
</td>
</tr>
<tr>
<td><font color="#FFFFFF">-----------</font></td>
</tr>
<tr>
- <td><A href="http://sourceforge.net/projects/nagios-snmp"> <IMG src="http://sourceforge.net/sflogo.php?group_id=134917&amp;type=3" width="110" height="37" border="0" alt="SourceForge.net Logo" /></A> </td>
+ <td><A href="http://sourceforge.net/projects/nagios-snmp">http://sourceforge.net/projects/nagios-snmp</A> </td>
</tr>
</table>
<!-- End Side Bar -->
@@ -437,7 +426,7 @@
<td>
<hr>
<p class="SectionBody">This project is hosted on : <br>
- <A href="http://sourceforge.net/projects/nagios-snmp"> <IMG src="http://sourceforge.net/sflogo.php?group_id=134917&type=5" width="210" height="62" border="0" alt="SourceForge.net Logo" /></A>
+ <A href="http://sourceforge.net/projects/nagios-snmp">http://sourceforge.net/projects/nagios-snmp</A>
</p>
<p class="SectionBody"> Nagios and the Nagios logo are registered
trademarks of Ethan Galstad.</p>
--- a/doc/html/nagios.manubulon.com/package_c.html
+++ b/doc/html/nagios.manubulon.com/package_c.html
@@ -162,7 +162,7 @@
<p class="SectionBody">This project is hosted on : <br>
- <A href="http://sourceforge.net/projects/nagios-snmp"> <IMG src="http://sourceforge.net/sflogo.php?group_id=134917&type=5" width="210" height="62" border="0" alt="SourceForge.net Logo" /></A>
+ <A href="http://sourceforge.net/projects/nagios-snmp">http://sourceforge.net/projects/nagios-snmp</A>
</p>

15
debian/patches/series vendored
View file

@ -1,15 +0,0 @@
10_check_snmp_storage_error_handling
11_check_snmp_int_agent_workaround
12_check_snmp_mem_perf
13_check_snmp_process_new_features
14_check_snmp_int_ign
15_check_snmp_int_spaces
16_check_snmp_win_max_message_size
17_check_snmp_storage_okifempty
18_check_snmp_int_fix_perf_out
19_check_snmp_int_remove_unneeded_my
20_check_snmp_int_avaid_huge_amount_of_regex
21_check_snmp_load_update_fortiswitch_and_fortigate4.3
22_check_snmp_storage_fix_space_btrfs
50_disable_epn
51_fix_privacy_doc

View file

@ -1,8 +0,0 @@
# check point firewall template, for more info see:
# http://www.manubulon.com/nagios/index_commands.html#cpfw
# 'check_snmp_cpfw_v3' command definition
define command {
command_name check_snmp_cpfw_v3
command_line /usr/lib/nagios/plugins/check_snmp_cpfw.pl -H $HOSTADDRESS$ $USER9$ $ARG1$
}

View file

@ -1,20 +0,0 @@
# system environment check template, for more see:
# http://www.manubulon.com/nagios/index_commands.html#env
# 'check_snmp_env_v1' command definition
define command {
command_name check_snmp_env_v1
command_line /usr/lib/nagios/plugins/check_snmp_env.pl -H $HOSTADDRESS$ -C $ARG3$ -T $ARG1$ $ARG2$
}
# 'check_snmp_env_v2' command definition
define command {
command_name check_snmp_env_v2
command_line /usr/lib/nagios/plugins/check_snmp_env.pl -H $HOSTADDRESS$ -C $ARG3$ -2 -T $ARG1$ $ARG2$
}
# 'check_snmp_env_v3' command definition
define command {
command_name check_snmp_env_v3
command_line /usr/lib/nagios/plugins/check_snmp_env.pl -H $HOSTADDRESS$ $USER9$ -T $ARG1$ $ARG2$
}

View file

@ -1,20 +0,0 @@
# (network-) interface check template, for more see:
# http://www.manubulon.com/nagios/index_commands.html#interface
# 'check_snmp_int_v1' command definition
define command {
command_name check_snmp_int_v1
command_line /usr/lib/nagios/plugins/check_snmp_int.pl -H $HOSTADDRESS$ -C $ARG3$ -n $ARG1$ -B$ARG4$ $ARG2$
}
# 'check_snmp_int_v2' command definition
define command {
command_name check_snmp_int_v2
command_line /usr/lib/nagios/plugins/check_snmp_int.pl -H $HOSTADDRESS$ -C $ARG3$ -2 -n $ARG1$ -B$ARG4$ $ARG2$
}
# 'check_snmp_int_v3' command definition
define command {
command_name check_snmp_int_v3
command_line /usr/lib/nagios/plugins/check_snmp_int.pl -H $HOSTADDRESS$ $USER9$ -n $ARG1$ -B$ARG4$ $ARG2$
}

View file

@ -1,20 +0,0 @@
# system load check template, for more see:
# http://www.manubulon.com/nagios/index_commands.html#load
# 'check_snmp_load_v1' command definition
define command {
command_name check_snmp_load_v1
command_line /usr/lib/nagios/plugins/check_snmp_load.pl -H $HOSTADDRESS$ -C $ARG5$ -T $ARG1$ -w $ARG2$ -c $ARG3$ $ARG4$
}
# 'check_snmp_load_v2' command definition
define command {
command_name check_snmp_load_v2
command_line /usr/lib/nagios/plugins/check_snmp_load.pl -H $HOSTADDRESS$ -C $ARG5$ -2 -T $ARG1$ -w $ARG2$ -c $ARG3$ $ARG4$
}
# 'check_snmp_load_v3' command definition
define command {
command_name check_snmp_load_v3
command_line /usr/lib/nagios/plugins/check_snmp_load.pl -H $HOSTADDRESS$ $USER9$ -T $ARG1$ -w $ARG2$ -c $ARG3$ $ARG4$
}

View file

@ -1,20 +0,0 @@
# system memory check template, for more see:
# http://www.manubulon.com/nagios/index_commands.html#mem
# 'check_snmp_mem_v1' command definition
define command {
command_name check_snmp_mem_v1
command_line /usr/lib/nagios/plugins/check_snmp_mem.pl -H $HOSTADDRESS$ -C $ARG5$ $ARG1$ -w $ARG2$ -c $ARG3$ $ARG4$
}
# 'check_snmp_mem_v2' command definition
define command {
command_name check_snmp_mem_v2
command_line /usr/lib/nagios/plugins/check_snmp_mem.pl -H $HOSTADDRESS$ -C $ARG5$ -2 $ARG1$ -w $ARG2$ -c $ARG3$ $ARG4$
}
# 'check_snmp_mem_v3' command definition
define command {
command_name check_snmp_mem_v3
command_line /usr/lib/nagios/plugins/check_snmp_mem.pl -H $HOSTADDRESS$ $USER9$ $ARG1$ -w $ARG2$ -c $ARG3$ $ARG4$
}

View file

@ -1,15 +0,0 @@
# system process check template, for more see:
# http://www.manubulon.com/nagios/index_commands.html#process
# 'check_snmp_process_v1' command definition
define command {
command_name check_snmp_process_v1
command_line /usr/lib/nagios/plugins/check_snmp_process.pl -H $HOSTADDRESS$ -C $ARG5$ -n $ARG1$ -w $ARG2$ -c $ARG3$ $ARG4$
}
# 'check_snmp_process_v2' command definition
define command {
command_name check_snmp_process_v2
command_line /usr/lib/nagios/plugins/check_snmp_process.pl -H $HOSTADDRESS$ -C $ARG5$ -2 -n $ARG1$ -w $ARG2$ -c $ARG3$ $ARG4$
}

View file

@ -1,20 +0,0 @@
# system storage check template, for more see:
# http://www.manubulon.com/nagios/index_commands.html#storage
# 'check_snmp_storage_v1' command definition
define command {
command_name check_snmp_storage_v1
command_line /usr/lib/nagios/plugins/check_snmp_storage.pl -H $HOSTADDRESS$ -C $ARG5$ -m $ARG1$ -w $ARG2$ -c $ARG3$ $ARG4$
}
# 'check_snmp_storage_v2' command definition
define command {
command_name check_snmp_storage_v2
command_line /usr/lib/nagios/plugins/check_snmp_storage.pl -H $HOSTADDRESS$ -C $ARG5$ -2 -m $ARG1$ -w $ARG2$ -c $ARG3$ $ARG4$
}
# 'check_snmp_storage_v3' command definition
define command {
command_name check_snmp_storage_v3
command_line /usr/lib/nagios/plugins/check_snmp_storage.pl -H $HOSTADDRESS$ $USER9$ -m $ARG1$ -w $ARG2$ -c $ARG3$ $ARG4$
}

View file

@ -1,20 +0,0 @@
# vrrp check template, for more see:
# http://www.manubulon.com/nagios/index_commands.html#vrrp
# 'check_snmp_vrrp_v1' command definition
define command {
command_name check_snmp_vrrp_v1
command_line /usr/lib/nagios/plugins/check_snmp_vrrp.pl -H $HOSTADDRESS$ -C $ARG3$ -T $ARG1$ -s $ARG2$
}
# 'check_snmp_vrrp_v2' command definition
define command {
command_name check_snmp_vrrp_v2
command_line /usr/lib/nagios/plugins/check_snmp_vrrp.pl -H $HOSTADDRESS$ -C $ARG3$ -2 -T $ARG1$ -s $ARG2$
}
# 'check_snmp_vrrp_v3' command definition
define command {
command_name check_snmp_vrrp_v3
command_line /usr/lib/nagios/plugins/check_snmp_vrrp.pl -H $HOSTADDRESS$ $USER9$ -T $ARG1$ -s $ARG2$
}

View file

@ -1,8 +0,0 @@
# windows check template, for more see:
# http://www.manubulon.com/nagios/index_commands.html#windows
# 'check_win' command definition
define command {
command_name check_win
command_line /usr/lib/nagios/plugins/check_snmp_win.pl -H $HOSTADDRESS$ -C $ARG3$ -n $ARG2$
}

29
debian/postinst vendored
View file

@ -1,29 +0,0 @@
#!/bin/sh
set -e
templdir=/usr/share/nagios-snmp-plugins/pluginconfig
if [ "$1" = "configure" ]; then
if [ -f /usr/share/monitoring-plugins/dpkg/functions ]; then
# only working with monitoring-plugins-basic
. /usr/share/monitoring-plugins/dpkg/functions
register_cfgs $2
elif [ -f /usr/share/nagios-plugins/dpkg/functions ]; then
# only working with nagios-plugins-basic (>= 1.4.5-2)
. /usr/share/nagios-plugins/dpkg/functions
register_cfgs $2
else
# to get working with etch
(
cd $templdir
for f in *cfg; do
ucf $f /etc/nagios-plugins/config/$f
done
);
fi
fi
#DEBHELPER#
exit 0

21
debian/postrm.in vendored
View file

@ -1,21 +0,0 @@
#!/bin/sh
set -e
PLUGINS="@PLUGINS@"
if [ "$1" = "purge" ]; then
if which ucf >/dev/null 2>&1; then
have_ucf="yes"
fi
for f in $PLUGINS; do
rm -f /etc/nagios-plugins/config/${f}.cfg
if [ "$have_ucf" = "yes" ]; then
ucf --purge /etc/nagios-plugins/config/${f}.cfg
fi
done
fi
#DEBHELPER#
exit 0

72
debian/rules vendored
View file

@ -1,72 +0,0 @@
#!/usr/bin/make -f
# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1
COMMANDDEFPATH:=/etc/nagios-plugins/config/
NP_DIR:=debian/nagios-snmp-plugins
NP_TEMPLATES:=$(NP_DIR)/usr/share/nagios-snmp-plugins/pluginconfig
NP_LIBEXEC:=/usr/lib/nagios/plugins
plugin_cfgs:=snmp_cpfw snmp_env snmp_int snmp_load snmp_mem snmp_process \
snmp_storage snmp_vrrp snmp_win
build: build-arch build-indep
build-arch: build-stamp
build-indep: build-stamp
build-stamp:
clean:
dh_testdir
dh_testroot
dh_clean
-rm -f debian/postrm
install: build
dh_testdir
dh_testroot
dh_prep
dh_installdirs
# Add here commands to install the package into debian/nagios-snmp-plugins.
for PLUGINS in plugins/*.pl; \
do \
install -D -m 0755 $$PLUGINS $(NP_DIR)$(NP_LIBEXEC)/`basename $$PLUGINS` || exit 1; \
sed -i "s#/usr/local/icinga/libexec#$(NP_LIBEXEC)#" $(NP_DIR)$(NP_LIBEXEC)/`basename $$PLUGINS` || exit 1; \
done
# copying templates them into seperate "template" directories outside of
# /usr/share/doc for ucf to use.
install -d $(NP_DIR)/usr/share/nagios-snmp-plugins/pluginconfig
for c in ${plugin_cfgs}; do \
cp debian/pluginconfig/$${c}.cfg ${NP_TEMPLATES}; \
done
# here the list of config templates are writen to postrm
sed -e 's/@PLUGINS@/${plugin_cfgs}/' \
< debian/postrm.in \
> debian/postrm
# copy html documentation over
install -d $(NP_DIR)/usr/share/doc/nagios-snmp-plugins/html/
cp -r doc/html/nagios.manubulon.com/* $(NP_DIR)/usr/share/doc/nagios-snmp-plugins/html/
# Build architecture-independent files here.
binary-indep: build install
dh_testdir
dh_testroot
dh_installchangelogs
dh_installdocs
dh_link
dh_compress
dh_fixperms
dh_perl
dh_installdeb
dh_gencontrol
dh_md5sums
dh_builddeb
# Build architecture-dependent files here.
binary-arch: build install
# We have nothing to do for now.
binary: binary-indep binary-arch
.PHONY: build clean binary-indep binary-arch binary install

View file

@ -1 +0,0 @@
3.0 (quilt)

View file

@ -1 +0,0 @@
extend-diff-ignore = '(^|/)(\.travis\.yml|\.git|\.github|\.gitgnore|config\.sub|config\.guess)'

View file

@ -1,5 +0,0 @@
---
Bug-Database: https://github.com/SteScho/manubulon-snmp/issues
Bug-Submit: https://github.com/SteScho/manubulon-snmp/issues/new
Repository: https://github.com/SteScho/manubulon-snmp.git
Repository-Browse: https://github.com/SteScho/manubulon-snmp

3
debian/watch vendored
View file

@ -1,3 +0,0 @@
version=4
opts=filenamemangle=s/.+\/v?(\d\S*)\.tar\.gz/nagios-snmp-plugins-$1\.tar\.gz/,uversionmangle=s/(\d)[_\.\-\+]?((RC|rc|pre|dev|beta|alpha)\d*)$/$1-$2/ \
https://github.com/SteScho/manubulon-snmp/tags .*/v?(\d\S*)\.tar\.gz