Icinga2 configuration: disk space, DNS resolution and ping monitoring not working via SSH Agent

I am trying to configure incinga2 open source at an AWS instance, for which I followed steps specified here - https://icinga.com/docs/icinga2/latest/doc/07-agent-based-monitoring/#agent-based-checks-ssh.
Code:
template Host “ssh-agent” {
check_command = “hostalive”

    vars.agent_type = "ssh"
    vars.os_type = "linux"

    /* Define http vhost attributes for service apply rules in `services.conf`. */
    vars.http_vhosts["http"] = {
    http_uri = "/"
    }

    /* Define disks and attributes for service apply rules in `services.conf`. */
    vars.disks["disk"] = {
            /* No parameters. */
    }
    vars.disks["disk /"] = {
            disk_partitions = "/"
    }

    /* Define notification mail attributes for notification apply rules in `notifications.conf`. */
    vars.notification["mail"] = {
    /* The UserGroup `icingaadmins` is defined in `users.conf`. */
    groups = [ "icingaadmins" ]
    }

}

For me SSL and Http checks are working via SSH Agent but other features such as - disk space, DNS resolution, ping monitoring are not working. Please assist.

Hi @Iamabhyas,

when you say these checks are not working – could you please provide some further information? It’s nearly impossible to help you without :slight_smile:

  • Is there something interesting logged?
  • Can you get more information in debug log?
  • The complete check config?

Cheers,
Marianne

1 Like

Hi @unixe

In my observation is :slight_smile:

For Disk space
Icinga server is connected with remote server using command (ssh -i $HOME/.ssh/id_rsa icinga@ssh-agent1.localdomain). it should be showing disk space stats of remote server instead of Icinga server.

For ping
Error says “PING CRITICAL - Packet loss = 100%” for SSL enabled domains, but it’s works fine for non SSL domains.

Template is provided already, below is the usage

object Host “ssh-agent1.localdomain” {
import “ssh-agent”
address = “192.168.56.xx”
}

Please provide steps to be followed for configuring the same.

As @unixe wrote log entries would be very interesting for helping you. Logs from icinga, system etc. also from your remote server :wink:

Did you test the check command on your shell on your remote Server? If it works there then you probably have a problem with your SSH Connection. Specially if you write this configuration works on non ssl domains. Another Problem could be permissions on your remote Server. Because you write some checks works and some not.

Hi,

As of now we have configured it and we are able to ssh to remote server and also run the command $host df -k which executed perfectly without any error.

When method, no error gets logged to console. Can you just provide me a list of mandatory variables to be set with details needed for the configuration.

ICINGA Server : Ubuntu 16.06
Remote Server : Ubuntu 14.04

Thanks in advance.

Hey Guys, anybody can help me please.

Yes we could, if you give us further informations we were asking for helping you. Without it’s only guessing …