Need help monitoring disk and other services agentless

Hi,
I’m a total novice, and I have been asked to install Incinga2 to monitor a few machines and their services, so i installed Icinga2 and Icingaweb by following a few tutorials.
So the configuration I have is one master(with icinga2) and then several host(agentless) that I would like to monitor without having to install anything on them, is that possible?
I’m asking because I added a host in conf.d/hosts.conf :
object Host “HOST2” {
import “generic-host”
address = “10.xxx.xxx.xxx” //IP of the monitored host
check_command = “hostalive”
}

object Service “disk_2” {
host_name = “HOST2”
check_command = “disk”
}
but the problem is that the value when i check on icingaweb is the value of the server .

Thanks for reading.

Hi,
I’m a total novice, and I have been asked to install Incinga2 to monitor a
few machines and their services, so i installed Icinga2 and Icingaweb by
following a few tutorials. So the configuration I have is one master(with
icinga2) and then several host(agentless) that I would like to monitor
without having to install anything on them, is that possible?

  1. The standard way to monitor a machine is to install Icinga on it, together
    with the appropriate service check plugins, and run it as an Agent.

  2. If you do not want to (or cannot) install Icinga itself, but can still
    install the service check plugins, then you can run the service checks via
    SSH:
    https://icinga.com/docs/icinga-2/latest/doc/07-agent-based-monitoring/#ssh

  3. If you are not even able to install the service check plugins, then you
    might be able to get the entire service check to run over SSH, but I don’t
    believe there is any documentation for this. Basically you would need to
    connect via SSH and run the service check script on the remote machine,
    getting the result back to the Icinga Master.

but the problem is that the value when i check on icingaweb is the value of
the server .

If you had Icinga installed as an Agent then the reason for this would be the
setting of command_endpoint, however if you have not installed Icinga then you
need to implement one of the above methods of connecting to the machine you
want to monitor so that you can get a result from it.

Incidentally, you say that you “have been asked to install Incinga2 to monitor
a few machines and their services”. Were you also asked not to install Icinga
as an Agent on the machines to be monitored? Otherwise, is there some reason
why this really isn’t possible?

Things work so much better if you can install an Icinga Master communicating
with Icinga Agents - it’s worth checking with whomever wants you to do this
whether there’s a good reason why this can’t be done.

Antony.

1 Like

Thank you for your answer Antony, i was asked to not install Icinga on the machines to be monitored so I’ll try to run the check by SSH.

You can of course also try to use SNMP. I recommend vn. 3, which is a lot more secure than previous versions. Should you decide to do this (your target hosts will have to be configured for it) I can probably recommend some plugins you could use (let me know).

For SSH you need to take certain configurative steps on your target hosts, relatively easy under Linux, a little harder under Windows (for which you will probably need Powershell plugins)…

Sorry for the delay in the answer, thanks for your reply Kai.What are the configurative steps I would have to take on my target hosts (Linux) ?, I’ve been reading on the forum, I came to understand that I have to:

  • Generate an ssh key
  • Copy the ssh pub key to my remote host
  • Install the Nagios plugins on my remote host
  • ?

No, SNMP is a very old protocol where the correspondingly activated service on your host offers information of its status to outside requesting servers (like your Icinga server) if these were added to an access list.

The whole point of SNMP is that it needs less set-up on your client host than other methods. On both Linux and Windows (Server) it is already present, but needs to be enabled. For vn. 3 of the protocol, in addition to that access list, you need to choose the mode, and then decide on i.d. stuff within that mode, e.g. login and pass phrase; this has to be set up on every host. (Under Windows you can use global policies to set it up once for many hosts. Probably something similar is possible for non-Windows op. systems, but I haven’t had much experience there…)

Then you need to find SNMP-able plugins in the WWW to download for your specific requirements - usage meters, interface monitors, health checkers, whatever. Some manufacturers of specialised h/w offer an SNMP-able Nagios-type check, or something more specific; you may have to check your install kit for that h/w, or contact the manufacturer.

Some scripts out there are pretty good, some not so well built (the latter may e.g. request too much info over time, e.g. by doing a request for every liitle bit of info, rather than doing a “bulk” fetch for all they need at once)…

Of course, all the requesting plugins for all the hosts run on the Icinga server itself, therefore not balancing the load more toward the hosts. But for most small to mid-range computer centres, SNMP is a valid alternative that your Icinga server can handle, as a rule.

P.S. (late edit): I just realised you may only want the configurative steps for SSH… Sorry, but there are quite a few good instructions findable in the WWW for that - look for descriptions of the generic “check_by_ssh” plugin; here’s a good German one: Icinga check by ssh Plugin – Thomas-Krenn-Wiki.

Thanks again for your time Kai, yes i was seeking mainly for the ssh method, i was actually following the instructions from Thomas Krenn (translated of course).

(Okay; all the stuff they write there after sync’ing the keys can also be done via the Director module of Icinga. If you don’t want to edit “cfg” files all the time, and are happy to use Icinga in a slightly reduced way, that module is good for i.a. beginners. You basically define the command incl. its needed variable arguments, then a service template that uses that command, then a service/check on a host that imports the template. Then deploy…)

I have been following this tutorial(translated) : Icinga2 check by ssh - steviesblog.de, since i didn’t understand the one from Thomas Krenn

I’m using the root user in both client and server.

So by following this tutorial i’ve added the 3 services to be monitored :
image

but i don’t understand why they all stuck on (PENDING).

the only modification i’ve made are these :
my host.conf :
image

my services.conf :

my zones.conf:

in my /var/log/icinga2/ debug.log i found this line :

notice/Process: PID 18715 (’/usr/lib64/nagios/plugins/check_ping’ ‘-H’ ‘10.1.1.2’ ‘-c’ ‘5000,100%’ ‘-w’ ‘3000,80%’) terminated with exit code 0

the fact that it terminated with code 0 should mean that there wasn’t an error ?

I strongly suggest that you as a beginner don’t get into zones in Icinga2 unless you have to; at any rate, do it later, when you have more experience! So, for this story here leave out the last two blackish boxes in that instruction completely; if you need to specify a zone use the same one used everywhere else in your config’s (“master”, I seem to remember). I.e. put everything in one zone to start off with.

P.S.: I am not going to go through detailed config’s with you here, sorry. Setting up a check using check_by_ssh is not much different to any normal service - if you’re not sure how to do this, practise by setting up some basic Linux checks for your Icinga server itself, first, using 127.0.0.1 as address - except that you have to first set up trusted login to the target host (easy to test by just running ssh loginname to the target from the Icinga server’s shell & getting there without having to enter a pass phrase or password), THEN setting up an executable plugin there, and noting the exact path you need on the host side to run it. This latter you then specify as arguments appropriately for your check_by_ssh command definition. Signing off…

Thanks for your answer and your time Kai, i’ll try to do so.
Good day.

(“Final final” hint: That link @Pooh gave you in his 1st reply in this thread, in option 2 there, basically describes all you need to do, EXCEPT set up a service template before you set up the service. You can do that (omit the template - templates are optional!) but esp. with remote SSH checks you will find that you are repeatedly setting the same lines in your service config’s again & again. A template allows you to set common things for a no. of services; you then only need to import the template in each of those, and add config’s that are still needed in addition or that are different to the ones in the template…)

1 Like