check_junos_vc - Monitor Juniper™ Switch Virtual Chassis¶
Usage / Command line options¶
% ./check_junos_vc.pl -h
check_junos_vc 0.1 [http://oss.teamix.org/projects/monitoringplugins]
This nagios plugin is free software, and comes with ABSOLUTELY NO WARRANTY.
It may be used, redistributed and/or modified under the terms of the 3-Clause
BSD License (see http://opensource.org/licenses/BSD-3-Clause).
Monitor Juniper™ Switch Virtual Chassis.
Usage: check_junos_vc [-v|--verbose] [-H <host>] [-p <port>] [-t <timeout]
[-U <user>] [-P <password] check-tuple [...]
-?, --usage
Print usage information
-h, --help
Print detailed help screen
-V, --version
Print version information
--extra-opts=[section][@file]
Read options from an ini file. See http://nagiosplugins.org/extra-opts
for usage and examples.
-H, --host=HOSTNAME
Hostname/IP of Juniper box to connect to (default: localhost)
-p, --port=PORT
Port to connect to (default: 22)
-U, --user=USERNAME
Username to log into box as (default: root)
-P, --password=PASSWORD
Password for login username (default: <prompt>)
-t, --timeout=INTEGER
Seconds before plugin times out (default: 15)
-v, --verbose
Show details for command-line debugging (can repeat up to 3 times)
This plugin connects to a Juniper™ Switch device and and checks Virtual
Chassis information.
A check-tuple consists of the name of the check and, optionally, a "target"
which more closely specifies which characteristics should be checked, and
warning and critical thresholds:
checkname[,target[,warning[,critical]]]
The following checks are available:
* members_count: Total number of members in the Virtual Chassis. If a target
is specified, only peers whose status (NotPrsnt, Prsnt) matches one of the
specified targets are taken into account.
* master, backup: Check the number or assignment of master resp. backup
members. If a target is specified, check that those members whose serial
number matches the specified target have the requested role (master,
backup) assigned to them. Else, check the number of master resp. backup
members against the specified thresholds.
* interfaces: Check that all VCP interfaces are up. If warning or critical
thresholds have been specified, also check the number of VCP interfaces
against the thresholds.
* version: Check the version of all physically connected members.
Warning and critical thresholds may be specified in the format documented at
http://nagiosplug.sourceforge.net/developer-guidelines.html#THRESHOLDFORMAT.
Quickstart¶
Check the total number of Virtual Chassis members:
% ./check_junos_vc.pl -H switch -U nagios members_count,Prsnt,3:,2:
Password:
check_junos_vc OK - 3 Prsnt members | members[Prsnt]=3;3:;2:;0; members=4;;;0;
Check the assignment of the master and backup members (specified by the serial number):
% ./check_junos_vc.pl -H switch -U nagios master,BP0211100544 backup,BP0211020125
Password:
check_junos_vc OK - 0 missing/failed-over masters, 1 active master (BP0211100544), 0 missing/failed-over backups, 1 active backup (BP0211020125) | active_master=1;;;0; failed_master=0;;;0; active_backup=1;;;0; failed_backup=0;;;0; members=4;;;0;
Check that all VCP interfaces are up and that there are at least two of them:
% ./check_junos_vc.pl -H switch -U nagios interfaces,,,2:
Password:
check_junos_vc OK - 3 VCP interfaces found (3 up, 0 down) | vcp_interfaces=3;;2:;0; up_interfaces=3;;;0; down_interfaces=0;;;0;
Check that the versions of all members are equal:
% ./check_junos_vc.pl -H switch -U nagios version
Password:
check_junos_vc OK - all members at version 10.4R1.9
Specifying passwords¶
The password for the login username may either be specified using the "-P" switch on the command line or using an INI file and the "--extra-opts" option.
% cat /etc/nagios3/plugin.ini
[junos]
password=geheim
% ./check_junos_vc.pl <…> --extra-opts=junos@/etc/nagios3/plugin.ini <check-tuples>
For more details about the "--extra-opts" option, see http://nagiosplugins.org/extra-opts.
If no password has been specified, the plugin will prompt for it.
Command line format¶
% ./check_junos_vc.pl -H switch [options] check-tuple […]
Format of a "check-tuple"¶
checkname[,target[,warning[,critical]]]
- Multiple checktuples may be specified as space separated list, e.g. "
master,BP0211100544 backup,BP0211020125" - Options are separated by commas (",") from the check name and other options, e.g. "
members_count,Prsnt,3:,2:"- Trailing "," may be omitted, e.g. "
peers_count" is the same as "peers_count,,," - The 2nd option specifies the target. A target more strictly specifies information relevant for each check.
- Leaving out the target or leaving it empty means that no restrictions apply to which information is relevant for the check (e.g. check the number of all members when not specifying a target in the "
members_count" check). - The 3rd (warning) and 4th (critical) options specify thresholds, see http://nagiosplug.sourceforge.net/developer-guidelines.html#THRESHOLDFORMAT for details.
- If no target but thresholds should be used, just leave the target option empty, e.g. "
interfaces,,,2:"
- Trailing "," may be omitted, e.g. "
Implemented checks¶
See help output above.