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


Remember Me

Directory Tree

SSH Password Authentication

1 vote
Current Version
Last Release Date
Compatible With
  • Nagios 1.x
  • Nagios 2.x
  • Nagios 3.x
  • Nagios XI
  • Nagios Fusion
ssh_pass_auth.phpPHP Code
ssh2-0.12.tgzSSH2 PHP Module
Network Monitoring Software - Download Nagios XI
Log Management Software - Nagios Log Server - Download
Netflow Analysis Software - Nagios Network Analyzer - Download
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)


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!