• Photos Photos
  • Linked In Linked In
  • Google + Google +
  • Facebook Facebook
  • Flickr Flickr
  • Vimeo Vimeo

www.gavinwill.me.uk

Photography, IT, Bikes and more.

  • Pages

    • About
    • Blog
    • Contact
    • Home
  • Archives

    • January 2013
    • September 2012
    • August 2012
    • July 2012
    • June 2012
    • May 2012
    • April 2012
    • March 2012
    • February 2012
    • January 2012
    • December 2011
    • November 2011
  • Search:

Posts

  • View Archive

Monthly: July 2012

Using Nagios Check_By_SSH to monitor remote systems.

Nagios is an amazing tool for monitoring and reporting and alerting of availability of hosts and services. I have typically only used simple SNMP checks or NRPE checks with a small agent installed on the remote host. I wanted to be able to measure a sites server room temperature via a USB probe that was on a remote box and installing NRPE or using SNMP was not an option. The only way to obtain the temperature was to run a command on the remote box. Thankfully Nagios has the inbuilt check_by_ssh command which allows nagios to connect up to a remote computer via ssh to then run the command. It does require SSH login via keys, thankfully this is also really easy to setup with ssh-keygen and ssh-copy-id.

It is important that these keys are generated as the user running nagios and a corresponding nagios user on the remote system.

On the Nagios server su into the running user for Nagios which will most likely be Nagios unless you have any customisations.

Run the command

ssh-keygen

ssh-keygen

This creates the public and private keys.

Copying the public key to the remote host is incredibly easy using ssh-copy-id

ssh-copy-id -i ~/.ssh/id_rsa.pub remote-host

ssh-copy-id -i ~/.ssh/id_rsa.pub remote-host

ssh-copy-id appends the keys to the remote-host’s .ssh/authorized_key

Now simply test connecting via ssh by running the command

ssh remote-host

ssh remote-host

You should connect straight away without being prompted for any password. If this is the case you can now create a custom command and service in nagios to monitor the remote-host and obtain any values / information you require to monitor.

  • July 30, 2012
  • 0
  • 0

Using Pushd to access sysinternal tools

Any windows admin will no doubt have used the amazing sysinternals tools. Having quick access to the tools has become a lot easier. Using the common command pusd you can connect upto the live repository of sysinternal tools and run the programs straight from the command line. No need to download all the tools then uncompress the archive just to run a specific tool you are after.

From a command prompt simply run

pushd \\live.sysinternals.com\tools

pushd \\live.sysinternals.com\tools

and it will map a drive to the sysinternals tools. Then simply run psexec, psloggedon, bginfo etc all from the command line or the mapped drive.

  • July 12, 2012
  • 0
  • 0

Copyright © 2021 www.gavinwill.me.uk.

  • LinkedIn
  • Google +
  • Facebook
  • Flickr
  • Vimeo
Back to Top