Home Directory Plugins Remote Access check_cisco_ssh_user_login

Search Exchange

Search All Sites

Nagios Live Webinars

Let our experts show you how Nagios can help your organization.

Contact Us

Phone: 1-888-NAGIOS-1
Email: sales@nagios.com

Login

Remember Me

check_cisco_ssh_user_login

Rating
0 votes
Favoured:
0
Current Version
1.0
Last Release Date
2019-03-31
Compatible With
  • Nagios 1.x
  • Nagios 2.x
  • Nagios 3.x
  • Nagios 4.x
  • Nagios XI
Owner
License
GPL
Hits
996
Files:
FileDescription
check_cisco_ssh_user_loginV 1.0
check_cisco_ssh_user_loginV 1.0 (Pubkey support)

Help Support Ethan Galstad's New Project:

Help Support Ethan

A Message From The Founder...

As the founder of Nagios, I'm asking for your help in a cause that's dear to my heart.

I'm launching a new project to help better the world by providing the information, ideas, and inspiration that I believe can improve the lives of people everywhere.

I know you're busy managing networks, but I would appreciate it if you would consider liking my Facebook page and showing your support for the content and messages I produce by sharing them with your friends and family.

You can learn more about my project by visiting ethangalstad.me/nagios. Thank you for your time. I wish you all the best in your endeavors, whatever they may be.

- Ethan

check_cisco_ssh_user_login
check_cisco_ssh_user_login 1.0

What it does
* Using state of the art non-blocking/async IO (EV and Mojolicious)
* Proper error handling !
* Login via SSH (hostname, username, password)
* Issue command "show users"
* Parse the output and find the user which we use for the connection
* Disconnect properly (no needless log violations in the cisco device)
* Return the correct exit value according to the output or errors (ssh->error)
* Tested with linux, darwin(osx), freebsd and openbsd (Could work with other derivates too !)
See github project for installation !
check_cisco_ssh_user_login 1.0
License

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 GNU General Public Licence (see http://www.fsf.org/licensing/licenses/gpl.txt).
What it does

Using state of the art non-blocking/async IO (EV and Mojolicious)
Proper error handling !
Login via SSH (hostname, username, password)
Issue command "show users"
Parse the output and find the user which we use for the connection
Disconnect properly (no needless log violations in the cisco device)
Return the correct exit value according to the output or errors (ssh->error)

Usage:

check_cisco_ssh_user [ -V|--version ] [-H|--hostname ] [-U|--username ] [-P|--password ] [-p|--port ] [-t|--timeout ]

-?, --usage | Print usage information

-h, --help | Print detailed help screen

-V, --version | Print version information

--host, -H | IP address or hostname of cisco device

--username, -U | username

--password, -P | password

--identiy, -I | private key file (mutually exclusive with password auth !)

--port, -p | tcp port to use (optional)

-t, --timeout=INTEGER |Seconds before plugin times out (default: 10)

-v, --verbose | prints extensive debugging info to stderr

This plugin was not tested on Windows.

Feel free to do so and report back !

At least use perl version 5.20 !

The user must have the privilege to issue the command 'show users'
Prerequisites (Linux and other derivates):
Debian (Build essentials) needed for EV and IO::Tty

apt-get install build-essential
Redhat (Devtools)

yum groupinstall 'Development Tools'
Installation of dependend modules
Using cpan:

cpan Mojolicous EV IO::Tty Net::OpenSSH Monitoring::Plugin
Using cpanm:

cpanm Mojolicous EV IO::Tty Net::OpenSSH Monitoring::Plugin
Example output

CISCO_SSH_USER_LOGIN OK - Found username autobackup on host 192.168.1.1
Timeout error

CISCO_SSH_USER_LOGIN CRITICAL - Error: Timeout (5s) connecting to host: example.com User: test Port: 22
Credits:

Mojolicious realtime framework
EV
Net::OpenSSH
Monitoring::Plugin
IO::Tty