Automating Nagios service checks via SSH

“Installing” check_http on the server

I could not install Nagios on the remote server, because it lacks a compiler, I don’t have the root password and, besides, I’m too busy to go foraging for software and installing it. Damn.

Would copying the check_http binary suffice? As it turns out, it didn’t. Lots of library errors, because my binary was linked against a different version of OpenSSL and the GNU C library. Damn. See for yourself:

[rudd-o@amauta2 ~]$ nagios/bin/check_http
nagios/bin/check_http: error while loading shared libraries: libssl.so.6: cannot open shared object file: No such file or directory

Solution to this problem: the brute-force way. I copied the binary, the GNU C library, the OpenSSL libraries and the ld-linux.so.2 program that runs ELF binaries. Check this out:

[rudd-o@amauta2 ~]$ pwd
/home/rudd-o
[rudd-o@amauta2 ~]$ ll nagios/bin nagios/lib
nagios/bin:
total 56
-rwxr-xr-x  1 rudd-o rudd-o 50660 Sep 16 23:25 check_http

nagios/lib:
total 3168
-rwxr-xr-x  1 rudd-o rudd-o  120352 Sep 16 23:31 ld-linux.so.2
-rwxr-xr-x  1 rudd-o rudd-o 1247272 Sep 16 23:28 libcrypto.so.6
-rwxr-xr-x  1 rudd-o rudd-o 1572400 Sep 16 23:30 libc.so.6
-rwxr-xr-x  1 rudd-o rudd-o  279384 Sep 16 23:26 libssl.so.6

Great, now it’s time to make it run. Keep reading.

Read on to page: « Previous Next » · 1 · 2 · 3 · 4 · 5 · 6 · 7

Share this article!

  • Digg it!
  • Slashdot it!
  • Share on Facebook
  • Bookmark it!

Sound off!

Write your own

Opinions

  1. Joe Says:

    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.