Automating Nagios service checks via SSH
Invoking check_http on my home workstation
So, I got this to work — partially. Let’s see if it still runs when I use SSH from my computer:
[rudd-o@andrea] [01:00:56] [~/bin] > ssh rudd-o.com bin/nagiosrun nagios/bin/check_http rudd-o@rudd-o.com's password:
check_http: Could not parse arguments Usage: check_http -H <vhost> | -I <IP-address> [-u <uri>] [-p <port>] [-w <warn time>] [-c <critical time>] [-t <timeout>] [-L] [-a auth] [-f <ok | warn | critcal | follow>] [-e <expect>] [-s string] [-l] [-r <regex> | -R <case-insensitive regex>] [-P string] [-m <min_pg_size>:<max_pg_size>] [-4|-6] [-N] [-M <age>] [-A string] [-k string] Great! But SSH is a big roadblock. It’s prompting me for a password. How do I automate that? Keep reading.
February 7th, 2008 at 19:42
Hi,
Why not generate a public /private key pair, then append the public key to /root/.ssh/authorized_keys on the target server? Then ssh will authenticate you on the basis of this key. You will need to establish the connection once manually, the target machine is added to a list of known hosts on the nagios server, from then on the logins will be silently granted without a password.