Skip to content
View in the app

A better way to browse. Learn more.

Unraid

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

[Support] Zabbix-Agent & Zabbix-Agent2

Featured Replies

Overview: Support for Docker template of the zabbix-agent container

Application: Zabbix-Agent - https://www.zabbix.com/

DockerHub:

Agent Version: newest stable

Minimum Server Version: 6.9.2

 

Please use this support for unraid/docker issues/questions only. Zabbix have its own community forums, when You can find lots of information.

  • Privileged mode does need to be left as enabled. This allows the agent to see system resources
  • Adding Disks for Monitoring:
    On the docker configuration page you will 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


Note, In Zabbix WebGUI You must set disk monitoring like Container Paths.

* Please specify which version is affected by the problem (Agent or Agent2)

  • VRx changed the title to [Support] Zabbix-Agent & Zabbix-Agent2
  • Replies 59
  • Views 24k
  • Created
  • Last Reply

Top Posters In This Topic

Most Popular Posts

  • supawiz6991
    supawiz6991

    Noted and your response is appreciated! Thanks for the work on the plugin as well!

  • Have you had FCP automatically fix that error?     It's deprecated for maintainers entering it.  But it is still used behind the scenes.  (No one ever gave it the correct value, so th

  • Got it working now.  For anyone who stumbles upon this I had to install nano (my prefered editor) apk add nano Then run to open the groups nano /etc/group I then manually added to the

Posted Images

  • Author

I have added branches, so You can choose which version will be installed:

  • default is 5.4 (latest stable)
  • 5.0
  • 4.4

Officially newer agent shoudn't work with older server.

Using https://hub.docker.com/r/zabbix/zabbix-agent

Fix common problems is reporting: 
Template URL for docker application zabbix-agent is not the as what the template author specified.The template URL the author specified is https://raw.githubusercontent.com/vrx-666/unraid-xml/master/my-zabbix-agent.xml. The template can be updated automatically with the correct URL.

Looking at the settings for the zabbix_agent docker I don't even seen an entry for the template url. Additionally I do not recall changing or removing it. 

Was this a new change or did the docker container possibly get damaged?

Update: An update for the docker image came through this morning, was applied, had fix common problems rescan, and the error persists. 

  • Author

TemplateURL is deprecated:
 


You can simply ignore that error.
 

Noted and your response is appreciated! Thanks for the work on the plugin as well!

Have you had FCP automatically fix that error?

 

2 hours ago, VRx said:

TemplateURL is deprecated:

 

It's deprecated for maintainers entering it.  But it is still used behind the scenes.  (No one ever gave it the correct value, so the appfeed automatically fills it out)

4 hours ago, Squid said:

Have you had FCP automatically fix that error?

 

 

It's deprecated for maintainers entering it.  But it is still used behind the scenes.  (No one ever gave it the correct value, so the appfeed automatically fills it out)

Ah ok. Yeah I went ahead and applied the fix via FCP. 

  • 2 weeks later...

Nice work on this! Is there anyway to monitor docker containers with this plugin? I am passing /var/run/docker.sock to the container but Zabbix reports the Docker service as down. Anyone had success?

  • Author

Because zabbix-agent2 in this container is running by the user without permissions to docker socket.
There is a possibility to run this, but You must have basic knowledge about linux shell systems.
You must check GID of docker group on Host (Unraid Server).
Log in to zabbix-agent2 container as root user (default  running "Console" from Unraid GUI made it but as zabbix user)
Add group docker (with same gid as on host/unraid server) inside zabbix-agent2 container.
Add user zabbix to this group.
Restart zabbix-agent2 container.
Note: You must do this again after every container update.

6 hours ago, VRx said:

Because zabbix-agent2 in this container is running by the user without permissions to docker socket.
There is a possibility to run this, but You must have basic knowledge about linux shell systems.
You must check GID of docker group on Host (Unraid Server).
Log in to zabbix-agent2 container as root user (default  running "Console" from Unraid GUI made it but as zabbix user)
Add group docker (with same gid as on host/unraid server) inside zabbix-agent2 container.
Add user zabbix to this group.
Restart zabbix-agent2 container.
Note: You must do this again after every container update.

 

First of all great job! Thanks for the template and guidelines.

 

I'm facing the same problem with the very same solution but I can't find a way to easily add the user "zabbix" into the group "docker" due to usermod command not installed.

Am I missing something?

 

I correctly create the group with:

 

docker exec --user root zabbix-agent2 sh -c "addgroup -g 281 docker"

 

Do you have any hint?

 

Thank you!

 

  • Author

You can do this by logging in as root:

docker exec -it --user=root zabbix-agent2 /bin/bash


Next, edit group file (/etc/group) in vim or sed. If You not familiar with vim, sed will be easier:

sed -i "s/docker:x:281:/docker:x:281:zabbix/g" /etc/group

 

Next, type "exit" to exit container shell, then You can restart container from Unraid GUI

 

BTW: Some trick could be used for things that not working from zabbix container, by setting up cron in User Scripts Plugin, this cron could monitor something, and write to file, which could be read by zabbix-agent, for example:
my script read parameters from ups tools, writing output to file on cache pool, zabbix-agent read this file and parse output to different items in zabbix.

1 hour ago, VRx said:

You can do this by logging in as root:

docker exec -it --user=root zabbix-agent2 /bin/bash


Next, edit group file (/etc/group) in vim or sed. If You not familiar with vim, sed will be easier:

sed -i "s/docker:x:281:/docker:x:281:zabbix/g" /etc/group

 

Next, type "exit" to exit container shell, then You can restart container from Unraid GUI

 

BTW: Some trick could be used for things that not working from zabbix container, by setting up cron in User Scripts Plugin, this cron could monitor something, and write to file, which could be read by zabbix-agent, for example:
my script read parameters from ups tools, writing output to file on cache pool, zabbix-agent read this file and parse output to different items in zabbix.

Thanks for this, this was something I didn't do. However after doing this the docker service is still reported as down in Zabbix.

58 minutes ago, mattmill said:

Thanks for this, this was something I didn't do. However after doing this the docker service is still reported as down in Zabbix.

Got it working now. 

For anyone who stumbles upon this I had to install nano (my prefered editor)

apk add nano

Then run to open the groups

nano /etc/group

I then manually added to the group file. Your GID (281 below) may differ on your host machine.

docker:x:281:zabbix

Save and reboot docker container and it now works

 

Just note that your GID may differ from the one above (281). To find your docker group ID run the below on your host machine

getent group docker | awk -F: '{printf "Group %s with GID=%d\n", $1, $3}'

 

Thanks for the pointers @VRx

Edited by mattmill
Add GID instructions.

  • Author
1 hour ago, mattmill said:

I then manually added to the group file. Your GID (281 below) may differ on your host machine.

Sed should do the same.

 

4 hours ago, VRx said:

You can do this by logging in as root:

docker exec -it --user=root zabbix-agent2 /bin/bash


Next, edit group file (/etc/group) in vim or sed. If You not familiar with vim, sed will be easier:

sed -i "s/docker:x:281:/docker:x:281:zabbix/g" /etc/group

 

Next, type "exit" to exit container shell, then You can restart container from Unraid GUI

 

BTW: Some trick could be used for things that not working from zabbix container, by setting up cron in User Scripts Plugin, this cron could monitor something, and write to file, which could be read by zabbix-agent, for example:
my script read parameters from ups tools, writing output to file on cache pool, zabbix-agent read this file and parse output to different items in zabbix.

 

I get the job done! thanks a lot.

With [PLUGIN] CA APPLICATION AUTO UPDATE I've added a script that runs after the update at container start. It should automate the permissions fix.

Core commands are:

 

docker exec --user root zabbix-agent2 sh -c "addgroup -g 281 docker"
docker exec --user root zabbix-agent2 sh -c "sed -i "s/docker:x:281:/docker:x:281:zabbix/g" /etc/group"

 

About User Scripts I've already set up a script that populates files:

 

sensors > /mnt/user/appdata/zabbix_agent/misc/scripts/temperatures_data
apcaccess > /mnt/user/appdata/zabbix_agent/misc/scripts/ups_data

 

Adding avolume binding "/var/local/:/var/local/" I'm able to use the template of @fabianonline (thans a lot!): https://git.schle.nz/fabian/unraid-zabbix_agent/raw/branch/main/zabbix_template.xml

  • 2 months later...

I have a userparameter config file I use on my servers to monitor the SMART info of my disks. It requires the use of an external script that has to execute on the server to collect the necessary information...

 

Here is the USERPARAMETER :

 

 

UserParameter=storage.discovery[*],sudo /opt/zabbix/smartctl-storage-discovery.sh

UserParameter=storage.get[*],sudo smartctl -i -H -A -l error -l background $1

UserParameter=smartctl.version,smartctl --version | grep -Eo "^smartctl\s[0-9\.[:space:]\r-]+" | sed -e 's/^smartctl\s//'

 

The content of the script file is a big long so I'll skip but my question is the following. I'm having a hard time to figure out how this would work since the agent is running in a container. Anyone has a clue?

 

  • Author

You can run script on host and write output to file, which could be read by zabbix container. This is the easiest way.
Most of templates are not prepared for zabbix-agent contenerized.

Yeah but I see various issues with that... I'll have to run a service that will periodically run a script on the server, save it to a file and drop it in a place the zabbix-agent2 will see it, process it, etc. Involves a lot of changes to existing templates on top of producing new scripts and services.

 

Ideally I could install the zabbix agent baremetal which I guess would have to reside on the USB key.... Same thing if I would use Prometheus... But not sure that is ideal, especially since it doesn't come as an addon with UNRAID so with new updates it could get in the way or just be wiped.

  • Author

[Here] is beta plugin, should work like baremetal I think, but it is only agent not agent2, so it can't monitor docker containers.

  • 1 month later...

Thank you very much for the information provided here. I was able to run the zabbix-agent2 in a docker container, and monitor other containers.
The only thing I'm missing to monitor is the free space on the root directory where the zabbix agent is running. I'm sending all of my monitored data to grafana, but it's not picking up the space utilization.
In the localhost, the root directory is in /dev/xvda.
Above you mentioned "Note, In Zabbix WebGUI You must set disk monitoring like Container Paths.", can you please elaborate a little bit on this last part?

  • Author

Sorry, I think I missed notification about reply.
 

On 1/4/2022 at 6:23 PM, capitan_lawrence said:

Above you mentioned "Note, In Zabbix WebGUI You must set disk monitoring like Container Paths.", can you please elaborate a little bit on this last part?

 

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

  • 1 month later...
On 11/14/2021 at 10:21 PM, tessierp said:

I have a userparameter config file I use on my servers to monitor the SMART info of my disks. It requires the use of an external script that has to execute on the server to collect the necessary information...

 

Here is the USERPARAMETER :

 

 

UserParameter=storage.discovery[*],sudo /opt/zabbix/smartctl-storage-discovery.sh

UserParameter=storage.get[*],sudo smartctl -i -H -A -l error -l background $1

UserParameter=smartctl.version,smartctl --version | grep -Eo "^smartctl\s[0-9\.[:space:]\r-]+" | sed -e 's/^smartctl\s//'

 

The content of the script file is a big long so I'll skip but my question is the following. I'm having a hard time to figure out how this would work since the agent is running in a container. Anyone has a clue?

 

 

Hello, im looking to add a user parameter to the agent docker aswell, by any chance did you figure out a way to insert it to the docker? 

  • 1 month later...

I'm a bit confused, how do I modify the config file to enable plugins?

 

is it possible to monitor docker on the unraid system?

  • Author
On 9/13/2022 at 8:25 PM, spyd4r said:

I'm a bit confused, how do I modify the config file to enable plugins?

Activating plugins may not have sense since the docker container does not have full access to the host operating system.

First of all, you need to consider what plugins you want to activate, whether they will be able to collect any data

You could try to configure path for agent conf file, and after this edit it.

 

On 9/13/2022 at 8:25 PM, spyd4r said:

is it possible to monitor docker on the unraid system?

You must carefully read previous posts

 

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...

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.