How to connect and monitor two different VPS each other?

Good day to everybody,

Can you help me, how to monitor 2 VPS each other?
I must have on both VPS icingaweb2 and there I must can see VPS1 and VPS2.

How to do it?
With director?

Thanks,
Kevin

a) You do not need to ask the same question twice within 12 hours of each
other

b) Have you simply tried it? Set up each machine as a standalone Master, and
then define each one as an Agent to the other.

c) I cannot comment on Director.

Regards,

Antony.

a) I´m sorry, but nobody answering me in last post.

b) I already tried this… On VPS1 (master) install icinga2, icingaweb2 and director. Than I configured director to monitor second vps (test). Everything worked, until I do the same on the second VPS (test).
How do you mean it? Run “icinga2 node wizard” setup it as master, and than in hosts.conf add second VPS? (this do on every VPS)
I´ve tried this, and this is not working. :confused: (it doesn´t monitor disk on second vps)

So… How to do it?

Thanks,
Kevin

a) I´m sorry, but nobody answering me in last post.

This is a volunteer community, not a help desk. People will answer if they
have time, and think they can help. Please also bear in mind that timezones
mean some people are going to be asleep when you ask a question, so don’t
expect a prompt reply from them :slight_smile:

b) I already tried this… On VPS1 (master) install icinga2, icingaweb2 and
director. Than I configured director to monitor second vps (test).
Everything worked,

Good, so you were definitely getting the correct results for both machines in
Icingaweb2 (not seeing the measurements for VPS1 shown for both VPS1 and VPS2,
which is a common problem at first)?

until I do the same on the second VPS (test).

I suspect a problem is that you’re trying to monitor both machines from each
other - and not just “monitor VPS1 from VPS2, and monitor VPS2 from VPS1”,
which is what I (mis-)read at first.

I can’t think of a way to have one machine monitored by two Icinga instances,
no matter where they’re installed (unless it’s an HA setup, but even that’s
not simultaneous monitoring by both Masters - they just share a database of
results).

How do you mean it? Run “icinga2 node wizard” setup it as master, and than
in hosts.conf add second VPS?

Yes, that was my idea, until I realised that you want VPS1 to be monitored not
only by VPS2 but also by VPS1, and I don’t think you can do this.

(this do on every VPS)

What do you mean by “every”? There are only two (but I think that is already
too many).

I´ve tried this, and this is not working. :confused: (it doesn´t monitor disk on
second vps)

Presumably it doesn’t monitor anything else on VPS2 either…?

So… How to do it?

I don’t think it’s possible to have one machine monitored by two separate
Icinga instances. The Parent - Child relationship between Master (Satellite)
and Agent means each Agent can only have one Master (defined as its Parent).

Regards,

Antony.

2 Likes

great, thanks.
But I don’t know if we understand …
I have two VPS servers - VPS 1 (master) & VPS 2 (test)
On each server I need to have the web interface icingaweb2 and there to see both servers. In case one server shuts down so that the other still works and sends an email that the one is not working. Do we understand each other?
To monitor each other. I had it done by installing icinga2 and icingaweb2 on each VPS and adding the other VPS to /etc/icinga2/conf.d/hosts.conf. The problem was that it did not monitor the second VPS (despite the fact that I entered the ip address, port, os, …) - it monitored http, but maybe the disk values ​​did not match. So I found the Director. I installed icinga2, icingaweb2 and director on one VPS1 (master) and connected VPS2 (test) to it, but as soon as I want to do the same on VPS2 and connect VPS1 to it, it doesn’t work. It makes a mistake.

We need to monitor it in HA to make it really reliable …

Do you have any ideas on how to do this?

Ah, if you’re asking about HA, have you tried
https://icinga.com/docs/icinga2/latest/doc/06-distributed-monitoring/
#high-availability-master-with-agents ?

Antony.

Yes, I was looked on it, but… I really don´t know, how to configure it. I don´t understand it.

Well, the first step is to install a standard Master; you’ve done that.

The second step is to install the other server as a Satellite. This is almost
identical to setting it up as an Agent, so you’ve pretty much done that as
well (although you should re-install this machine properly so that it really
is a Satellite).

For testing / proof of concept purposes, I would suggest ignoring the
recommendation to have a separate database server with a virtual IP address,
and either:

a) set up MySQL Master-Master replication if you’re comfortable with this, or

b) set up MariaDB with Galera replication if you’re happy with that, or

c) set up a single MySQL server and simply point both Icinga Masters at it (it
can be on one of the icinga machines).

That last one won’t give you true HA, but it’s a good starting point for
learning about the HA aspect of Icinga without having to learning about
database clusters at the same time.

So, I suggest you follow through the steps outlined there and post back here
when you run into any problems; there are plenty of people who’ve set up HA
Icinga and are quite possibly willing to help out.

Have fun,

Antony.

Thanks, I´ll try it.

Point c) is best for me I think.

And connect to the same database?
Or make new database called “icinga2_sattelite”?

And… after I connect sattelite to VPS1 (master), must I configure any configuration in hosts.conf, or something like that?

Thanks,
Kevin

And here´s problem… :confused:
(I´m installing

Route to my PHPMyAdmin login -> xx.xx.xx.xx:8080/phpmyadmin
How to assign it to icinga2?