Home Directory Plugins Network Protocols SSH SSH Password Authentication

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

Directory Tree

SSH Password Authentication

Rating
1 vote
Favoured:
0
Current Version
1.1
Last Release Date
2013-07-26
Compatible With
  • Nagios 1.x
  • Nagios 2.x
  • Nagios 3.x
  • Nagios XI
  • Nagios Fusion
Hits
43413
Files:
FileDescription
ssh_pass_auth.phpPHP Code
ssh2-0.12.tgzSSH2 PHP Module
Nagios CSP

Meet The New Nagios Core Services Platform

Built on over 25 years of monitoring experience, the Nagios Core Services Platform provides insightful monitoring dashboards, time-saving monitoring wizards, and unmatched ease of use. Use it for free indefinitely.

Monitoring Made Magically Better

  • Nagios Core on Overdrive
  • Powerful Monitoring Dashboards
  • Time-Saving Configuration Wizards
  • Open Source Powered Monitoring On Steroids
  • And So Much More!
Connects to a remote system through SSH using PHP using username & password authentication.

No need to compile just run using php and your away.

You do need PHP module ssh2 this is a one file installation with pecl (I've even attached the module in case if like me your servers aren't attached to the internet)

http://www.php.net/manual/en/ssh2.installation.php
http://pecl.php.net/package/ssh2

Be gentle I'm not a PHP expert ;-)
There doesn't appear to be any system available with nagios to login via SSH using a username and password without compiling a lot of tools which was not practical for us, so I write my own PHP system.

There is now a terminal mode, if you find the command waits forever this is likely because the command has been processed and its offered up a # prompt to the system which will cause it to wait forever and a day, however the -t option will open a virtual terminal and will end by sending an exit command which should solve the issue.

The script is designed to be called from within other systems which is why its very generic.

SSH Online Password Authentication System v1.1
Connects over ssh using a username and password
/opt/openitc/nagios/libexec/ssh_pass_auth.php -h [HOSTIP] -u [USER] -p [PASS] -t -d -m -c [COMMAND]
-m Mulitple commands, parse each seperately, seperate with ; in the command string
-d Debug, print what's happening
-t Open a virtual terminal (used if you are having problems with the standard mode)
Reviews (1)
The libssh2 requirement that this plugin has makes it not as deployable or as reliable as it could be. In particular, I'd suggest the SSH auth stuff be rewritten to use phpseclib: http://phpseclib.sourceforge.net/

Good plugin otherwise!