Monitoring Subsite


#1

Hi all,

I have site1 and site2 on the same Server.

I want add the site to as Distributed Monitoring, what’s the best practice for this ?

Thanks in advance

Regards
Neeloj


(Philipp Näther) #2

What is the reason for having an additional site, connected via distr. monitoring, on the same server?


#3

thanks for your answer @TheLucKy and very good question:

we have site1 “Master site” and site2 “Slave site” for customers they dont have Check_MK. we read the txt file which are on a cloud.

And I want see all of them on the Master Site and not on the Slave site, because we have our systems on Master Site and I dont want mix them.

Im Reading this now: https://mathias-kettner.de/cms_distributed_monitoring.html
thanks


(Philipp Näther) #4

Ok I understand.

So you have to omd config slave and set the livestatus tcp setting to on. Beware that you have to use a free port on your server! Default is 6557, but if you already have enabled another site, you might want to choose a port after that like 6558 or 6559.

After that continue in WATO of your master like you would do to connect any other remote site via tcp.


#5

perfect thats what I did :slight_smile:
Ill test that and give a feed back for others too

I appreciate your help a lot @TheLucKy :+1:


(Philipp Näther) #7

Try to change the only from address to 127.0.0.1.


#8

yes I did that

and On the Master site I can see only on [Main Overview] link events for a site on the Slave, why I cannot see all services, when I search in Quick Search I dont see anything.

I want to create a WATO rule on master for host on slave to test if that work.


(Philipp Näther) #9

If you go to “All hosts” or “All services” for example, you should see both your sites and the according hosts/services for those sites:

1

Quicksearch shows hosts/services for all connected sites.

Rules should be written to the slave site if you enabled “push configuration to slave site”.


#10

yes thats exactly what Im expect but its empty, All hosts and All services
only on main overview I can see some services.

And when I click on the host name on main over view and then WATO I get: You called this page with an invalid host name.


(Philipp Näther) #11

Are you sure you are checking on the correct site?
Also double check if your distributed monitoring configuration is correct.
Usually this distr. setup works like a charm out of the box if everything is set up correctly.


#12

as you siad, its very easy and here is my configs:
11111111111111

and create a new connection after that login:


(Philipp Näther) #13

Please use the DNS name for URL prefix and Multisite-URL instead of 127.0.0.1 and see if that changes anything. The rest looks fine so far.


#14

I used the IP address and the DNS its still the same, and on the page, they use IP:

https://mathias-kettner.com/cms_distributed_monitoring.html


(Philipp Näther) #15

It is hard to tell what is going wrong from here on.
Did you restart the slave site after the omd config?


#16

Yes I did that.

When I change the port to 6558 and start the slave site I run also cmk -R and -O and also on the master

And my host is disappear!!! I thought because I change the port.

So I create the host again on slave but it’s still the same!

I really don’t now what’s going on!
I don’t get any errors or so.

Is there a way in cmd to see the output on 6558 ?

Thanks again


(Philipp Näther) #17

You can access this socket the same way you would query the local livestatus socket. But instead of unixcat you use netcat.


#18

netcat localhost 6556 I get result but not for 6558 its really strange!
Ill delete the site and create it again and change the port and after that Ill create the host and bind to Master site!


(Philipp Näther) #19

Something like this echo "GET hosts" | netcat 127.0.0.1 6558 has to work. If not, the socket is not listening correctly.


#20

I dont know why but it works now after I delete the site and create it again with same above steps.
The ONLY DIFFERENT thing what I did is: I create the host on MASTER but I change the Monitored on site to SLAVE1 and now I can see the host and services on master and also in slave, and on slave the WATO is disabled because I did that.

there 2 things:

  1. because of port because the first one is 6556 and the second MUST be 6557 ?
  2. because I create the host on Master and before I created always on slave ?

but it works, Ill play with it again.

thank you so much


(Philipp Näther) #21

No it does not matter which port you use if it is free.

No, hosts that have been created on a site before the site became a slave in a distributed setup usually do not cause any problems.

Maybe you had different cmk versions on your sites that caused the issue?