[Support] Zabbix-Agent & Zabbix-Agent2


Recommended Posts

@VRx Im having a touch of difficulty. 

If i run Zabbix Agent, Server, and Web Interface all on host network, im all good. 

However, if i run them on Br0 network, i lose the ability to monitor my unraid network interface traffic. 

Using key net.if.in and net.if.out, i believe it monitors network interfaces listed in /proc/net/dev. 

When running agent on Br0, it appears, proc/net/dev is of the container, not the host system, and it doesnt appear that i can pass the host file to the container. 

Any chance i could get some help with that?

Also, it doesnt seem that Agent, Server and Web Interface can be on the same Br0 IP address, even though there all using different ports.

Link to comment
  • 2 weeks later...
On 9/16/2022 at 10:56 PM, TurboStreetCar said:

Also, it doesnt seem that Agent, Server and Web Interface can be on the same Br0 IP address, even though there all using different ports.

I omit the technical possibilities but do you think it logical that two containers should use the same ip? Do you also assign the same ip for two computers in the network?

 

 

On 9/16/2022 at 10:56 PM, TurboStreetCar said:

When running agent on Br0, it appears, proc/net/dev is of the container, not the host system, and it doesnt appear that i can pass the host file to the container. 

https://forums.docker.com/t/container-read-host-proc-net-dev/3439

 

Link to comment
On 9/16/2022 at 10:56 PM, TurboStreetCar said:

Any chance i could get some help with that?

You could try to bind /proc/net/dev to /host/proc/net/dev inside container.
But You need also to instruct zabbix agent it should monitor /host/proc/net/dev.
I have not tried this solution.

  • Like 1
Link to comment
On 9/28/2022 at 3:11 AM, VRx said:

I omit the technical possibilities but do you think it logical that two containers should use the same ip? Do you also assign the same ip for two computers in the network?

 

 

Well, i would say computers are different that containers, as containers only use specific ports and have specific purposes. Additionally, when on host network, they all are using the same IP. I'm aware internally there is separate networks broken up within Unraid, or dockers network system, but externally, all three containers (Zabbix Agent, Server, and Web Interface) are all on the same host IP. Would be nice to break that out to a separate network.

 

On 9/28/2022 at 3:23 AM, VRx said:

You could try to bind /proc/net/dev to /host/proc/net/dev inside container.
But You need also to instruct zabbix agent it should monitor /host/proc/net/dev.
I have not tried this solution.

 

I will try passing /proc/net/dev to the container at the /host/ path, but im not sure how to "reroute" the net key to that new location. i assume it would be somewhere in the conf file? Only issue with that is updates would break that modification. 

Appreciate the input. 

Link to comment
On 9/30/2022 at 11:34 AM, TurboStreetCar said:

Well, i would say computers are different that containers, as containers only use specific ports and have specific purposes.

This is not as clear cut as you say, it depends on the configuration. The assignment of the ip address to the container is the use of the macvlan driver. This assigns the mac address to the container and binds it to the physical network. This is a very different situation to the one you describe and is much closer to computers than containers.
 

 

On 9/30/2022 at 11:34 AM, TurboStreetCar said:

Additionally, when on host network, they all are using the same IP. I'm aware internally there is separate networks broken up within Unraid, or dockers network system, but externally, all three containers (Zabbix Agent, Server, and Web Interface) are all on the same host IP. Would be nice to break that out to a separate network.

How can I help You? This is how bridged and macvlan networks are working in docker environment.
It is not my fault and it is also not the fault of the unRAID developers. Quite simply, docker was created for something other than what is used by many. For many reasons, a container should represent one service / process, meanwhile, we build containers that include a database, an application or several applications. Probably if you build one image containing the agent server and zabbix web it will work according to your expectations. I am not in favor of duplicating applications since they already exist in the image repository. Unfortunately, but applications such as zabbix server should be run in a host or virtual machine, not in a container, it will not cause such problems.
 

On 9/30/2022 at 11:34 AM, TurboStreetCar said:

I will try passing /proc/net/dev to the container at the /host/ path, but im not sure how to "reroute" the net key to that new location. i assume it would be somewhere in the conf file? Only issue with that is updates would break that modification. 

Try looking for a solution on the zabbix community forum

Link to comment
  • 1 month later...
On 1/11/2022 at 6:25 AM, VRx said:

Sorry, I think I missed notification about reply.
 

 

On the docker configuration page you have preconfigured /mnt/user and /mnt/cache (as array and cache pool).
You can change it on Your own, for example by disk or maybe add some other pools.
Access Mode can be just Read Only
For example:
/mnt/user on host You can bind to /mnt/array in zabbix agent container

/mnt/cache on host You can bind to /mnt/something in zabbix agent container
In Zabbix GUI You must set container paths to monitor, so:
/mnt/array
and

/mnt/something

I'm drawing a blank here. I've got the template configured using Linux by Zabbix Agent and it's working great. It has discovered /mnt/cache but it is not discovering /mnt/array. 

 

It has also discovered all sorts of other filesystems (/, /etc/hostname - and some others). I assume those are related to the docker file as they seem to be detecting my docker file size.

 

Any tips to get /mnt/array detected?

Link to comment
  • 1 month later...

How do I get userparameter support with this?
I updated my unraid from an older version and my locally "installed" version of the stand-alone agent segfaults on launch now. Switching to this container works, but I cannot seem to figure out how to get all my custom userparameter scripts over for monitoring individual disks.

Edited by chaosratt
typos
Link to comment

@chaosratt

"You may write a command that retrieves the data you need and include it in the user parameter in the agent configuration file ('UserParameter' configuration parameter)."

docs

"Allowed volumes for the Zabbix agent container
/etc/zabbix/zabbix_agentd.d

The volume allows include *.conf files and extend Zabbix agent using UserParameter feature."

more info

 

So You should add another docker volume /etc/zabbix/zabbix_agentd.d

And make some .conf files inside

 

Link to comment
  • 2 weeks later...
On 11/30/2022 at 2:17 PM, autumnwalker said:

I'm drawing a blank here. I've got the template configured using Linux by Zabbix Agent and it's working great. It has discovered /mnt/cache but it is not discovering /mnt/array. 

 

It has also discovered all sorts of other filesystems (/, /etc/hostname - and some others). I assume those are related to the docker file as they seem to be detecting my docker file size.

 

Any tips to get /mnt/array detected?

Any follow up on this?  I'm having the same situation - just detects the cache disk, and despite the mount point of /mnt/array in the container pointing to /mnt/user on unraid, zabbix isn't discovering the array...

Link to comment
  • 10 months later...

Thanks for the docker, I just started messing about with Zabbix for monitoring all of my homelab, really like it.

Lots of nice stats that I can import as graphs as you can see from the pic below...

image.thumb.png.21f93df6e191e4961d59d940a9d24fcb.png

 

One thing that is missing is the output from sensors (lmsensors) from the UNRAID host.

Is it possible to configure the docker to grab sensors output? I have a USB corsair PSU and temperatures that I would like to add to Zabbix.

 

Thank you.

Link to comment
15 hours ago, VRx said:

@mikeyosm

You could try to bind paths:

/usr/bin/sensors from host to /usr/local/bin/sensors
/usr/lib64/libsensors.so.5 to /usr/lib64/libsensors.so.5 [RO]

And lmsensors should work inside the container

UPDATE - I got it working!

 

image.thumb.png.83e108b6d3543aa53c6e2abcba579fe2.png

 

 

 

 

Edited by mikeyosm
Link to comment
  • 1 month later...

Hey,

 

I'm monitoring the Eth0 interface with Zabbix but it's not adding up with what Unraid is reporting. 

 

Zabbix is reporting a few Kbps, but Unraid is reporting 100+ Mbps.

 

Unraid is correct as I was watching a film through plex container, which uses this interface. 

 

Is there something I need to change?

 

Screenshots attached here of what Unraid web ui shows me, and what Zabbix is reporting.

 

 

Screenshot 2024-02-12 at 20.03.50.png

Screenshot 2024-02-12 at 20.03.01.png

Edited by Deadringers
Link to comment

There is no good solution.
eth0 inside container is not the same as host interface.
You could use host network with zabbix agent container, but macvlan not allow to connect from other vlans/subnets configured on Unraid server, if You use some.

  • Like 1
Link to comment
  • 2 weeks later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.