Zabbix Agent (solved, docker instructions here)


Who wants the Zabbix Agent on unRAID?   

5 members have voted

You do not have permission to vote in this poll, or see the poll results. Please sign in or register to vote in this poll.

Recommended Posts

As you can see from the title, my request is to either add or add the ability to add the Zabbix Agent.

 

I run a Zabbix Server and although I currently use the SNMP plugin to be able to gather data from my unRAID server, I would rather be able to use the Zabbix Agent.

 

I have added a Poll to see how many people want this added as a feature.

 

EDIT: Thanks for the suggestion jonathanm. So Zabbix is a monitoring tool that allows you to monitor network connected devices. It allows you to see data such as CPU usage, RAM usage and Storage usage, within a unified platform.

 

You can also setup triggers and message notifications of issues (eg High CPU, device down, port down, etc). For my setup I have multiple VMs running and recently it allowed me to see (due to a alert/trigger) that my VM was using a lot of its swap space. This then allowed me to investigate and find out what was causing the issue.

 

I hope this helps you understand what Zabbix is and does.

Edited by Conmyster
Suggestion from jonathanm
Link to comment

For those of us who have never heard of Zabbix, perhaps it would be in your best interest to describe things a bit more. If you put forward a compelling case as to why we should want it, you may get more interest.

 

My first thought is "Why should I care about Zabbix?" If you can answer that in a way that makes someone want to start using it, you will get a better response.

 

Or, perhaps I'm just a luddite and everyone who is cool already knows and uses Zabbix. In that case, never mind.

Link to comment
28 minutes ago, jonathanm said:

For those of us who have never heard of Zabbix, perhaps it would be in your best interest to describe things a bit more. If you put forward a compelling case as to why we should want it, you may get more interest.

 

My first thought is "Why should I care about Zabbix?" If you can answer that in a way that makes someone want to start using it, you will get a better response.

 

Or, perhaps I'm just a luddite and everyone who is cool already knows and uses Zabbix. In that case, never mind.

 I have edited my main post, hopefully this helps and thanks for the suggestion.

Link to comment

What needs to be built in at the kernel level for this (as Limetech would need to provide this).  The remainder could then be provided as a plugin/docker so that it can be de-coupled from the core Unraid product.   Doing it that way is more likely to get acceptance as it keeps to a minimum what Limetech has to actually directly deliver and support.

Link to comment
6 minutes ago, itimpi said:

What needs to be built in at the kernel level for this (as Limetech would need to provide this).  The remainder could then be provided as a plugin/docker so that it can be de-coupled from the core Unraid product.   Doing it that way is more likely to get acceptance as it keeps to a minimum what Limetech has to actually directly deliver and support.

I did attempt to use the Zabbix Agent docker (in privileged mode) how ever it was not able to detect the disks etc. Not to mention it was not getting all the data like a direct Zabbix Agent would get.

Link to comment

I had a quick look at the documentation and it looks like support could be added without getting Limetech involved at all.  
 

It is surprising that you could not get the agent installed as a docker as that seems to be supported.     However I could see it being tedious to configure as it appears you would have to pass through every disk to be monitored with its own volume mapping.    However it should be relatively easy to compile a version of the agent to be installed via a plugin if the docker approach cannot be made to work sensibly.

 

If you also wanted the server component then I assume the easiest way to do that would be as a docker container.

Link to comment
3 minutes ago, itimpi said:

I had a quick look at the documentation and it looks like support could be added without getting Limetech involved at all.  
 

It is surprising that you could not get the agent installed as a docker as that seems to be supported.     However I could see it being tedious to configure as it appears you would have to pass through every disk to be monitored with its own volume mapping.    However it should be relatively easy to compile a version of the agent to be installed via a plugin if the docker approach cannot be made to work sensibly.

 

If you also wanted the server component then I assume the easiest way to do that would be as a docker container.

Myself I only need the agent as I run the sever in a VM on my Proxmox Environment.

 

When you say "relatively easy" to compile a version of the agent to be a plugin. How easy would that be? As I am not overly confident when it comes to coding/scripting.

 

Link to comment
1 minute ago, Conmyster said:

Myself I only need the agent as I run the sever in a VM on my Proxmox Environment.

 

When you say "relatively easy" to compile a version of the agent to be a plugin. How easy would that be? As I am not overly confident when it comes to coding/scripting.

 

UnRAID is based on Slackware so the way to do this would be to create a Slackware VM and then follow the instructions to create a statically linked version of the agent from the sources that would result in a binary that can run on Unraid.   There are also some users that need to be created and these should probably be redone on each boot.   Thinking about it this could be done using the User Scripts plugin with a simple script set to run on first array start rather than writing a separate plugin.

 

I already have a Slackware VM for other reasons, so if I can find some time I might have a go at doing this myself.

Link to comment
21 minutes ago, itimpi said:

UnRAID is based on Slackware so the way to do this would be to create a Slackware VM and then follow the instructions to create a statically linked version of the agent from the sources that would result in a binary that can run on Unraid.   There are also some users that need to be created and these should probably be redone on each boot.   Thinking about it this could be done using the User Scripts plugin with a simple script set to run on first array start rather than writing a separate plugin.

 

I already have a Slackware VM for other reasons, so if I can find some time I might have a go at doing this myself.

Ok great to hear! In the mean time I may take more of a deep dive to try and get the disks seen by the docker container version of the agent.

 

Link to comment

So it seems that with doing a bit more of a play around I can get the docker Zabbix Agent to work.

 

See the image attached.

 

As you can see to add disks it is a bit of a manual task each disk has to be added as a path to the docker.

 

The only trigger within Zabbix I had to disable for my unraid server was "Lack of Swap" as it seems unraid does not make use of swap memory.

Zabbix Agent.PNG

Edited by Conmyster
Link to comment
1 hour ago, jonathanm said:

Possibly also @trurl may want to move the thread to a different subforum, since feature requests is definitely no longer the proper place for it.

I closed the poll. I can move this thread but not sure where it should go. If @Conmyster wants to put a little more effort into getting a CA conformant template and agrees to support it we could move it to Docker Containers.

Link to comment
13 minutes ago, trurl said:

I closed the poll. I can move this thread but not sure where it should go. If @Conmyster wants to put a little more effort into getting a CA conformant template and agrees to support it we could move it to Docker Containers.

@trurl Personally I would do if I knew how to...

 

If it came from CA then I would like it to have the ability to auto add the disks (or allow user to choose which disks to add). This way it is less of a manual task for the user.

Edited by Conmyster
Link to comment
31 minutes ago, Conmyster said:

@trurl Personally I would do if I knew how to...

 

If it came from CA then I would like it to have the ability to auto add the disks (or allow user to choose which disks to add). This way it is less of a manual task for the user.

CA doesn't really have that ability. It just takes the templates that have already been prepared and launches the Add Container page with the template. That page uses the template to fill in the fields for volume mappings, etc. Since your template would have an unknown number of optional volume mappings, those fields couldn't be part of the template and would have to be left to the user to fill in.

 

I am not familiar with this application, but all of the disks are under /mnt. Also under /mnt are /mnt/user, the user shares, /mnt/user0, the user shares excluding data still on cache, and /mnt/disks, where Unassigned Devices mounts things. If you just map /mnt instead of each disk individually, would that work and be useful?

Link to comment
Just now, trurl said:

CA doesn't really have that ability. It just takes the templates that have already been prepared and launches the Add Container page with the template. That page uses the template to fill in the fields for volume mappings, etc. Since your template would have an unknown number of optional volume mappings, those fields couldn't be part of the template and would have to be left to the user to fill in.

 

I am not familiar with this application, but all of the disks are under /mnt. Also under /mnt are /mnt/user, the user shares, /mnt/user0, the user shares excluding data still on cache, and /mnt/disks, where Unassigned Devices mounts things. If you just map /mnt instead of each disk individually, would that work and be useful?

The issue with adding /mnt to the agent docker is that it would calculate the total, used and free space of everything inside of it and would treat /mnt as one device.

 

The issue with this is that each user share is in /mnt as well as cache and the disks.

 

I guess a template could be made with a default of x amount of disks and cache added. I am unsure on how Zabbix would treat a disk that isn't actually there. (I will have to test this.)

Link to comment

Okay so after a quick test:

 

I added /mnt/disk6 and /mnt/disk7 as paths within the Zabbix Agent docker (My server has no disk6 or disk7 installed).

 

I then ran a manual discovery check within Zabbix and as hoped it only found the actual disks that are there.

 

This means I expect the best method would be to create the template with the 30 disks max and the 1 cache. If @trurl could provide some assistance on how to and where to submit a template I would be happy to create it.

Link to comment
So now that the XML has been created and I have created a support topic. I would say this thread can now be closed.
 
Link to support thread (will be updated once moved to correct section by moderator)
 


Interesting, will definitely have a look at this when I have some time over to configure my Zabbix server again. Nice work!
Link to comment
Okay so after a quick test:
 
I added /mnt/disk6 and /mnt/disk7 as paths within the Zabbix Agent docker (My server has no disk6 or disk7 installed).
 
I then ran a manual discovery check within Zabbix and as hoped it only found the actual disks that are there.
 
This means I expect the best method would be to create the template with the 30 disks max and the 1 cache. If @trurl could provide some assistance on how to and where to submit a template I would be happy to create it.
One problem with adding all of the mounts is that IIRC the docker system will automatically create the paths and they will wind up in RAM if they dont get deleted from when the user adds the template. Not sure how the user share system will respond to that.

But, fix common problems has had a test in place for this situation for quite awhile

Sent from my NSA monitored device

Link to comment
5 minutes ago, Squid said:

One problem with adding all of the mounts is that IIRC the docker system will automatically create the paths and they will wind up in RAM if they dont get deleted from when the user adds the template. Not sure how the user share system will respond to that.

But, fix common problems has had a test in place for this situation for quite awhile

Sent from my NSA monitored device
 

My docker I created has all 30 disks and cache added like my XML template.

 

I have not noticed any large spikes in RAM. The current RAM usage of my Zabbix Agent docker is hovering around 6.8MB - 7.2MB

Link to comment
34 minutes ago, Squid said:

One problem with adding all of the mounts is that IIRC the docker system will automatically create the paths and they will wind up in RAM if they dont get deleted from when the user adds the template. Not sure how the user share system will respond to that.

11 minutes ago, Conmyster said:

I have not noticed any large spikes in RAM. The current RAM usage of my Zabbix Agent docker is hovering around 6.8MB - 7.2MB

What do you get from the command line with this?

ls /mnt

 

Link to comment
When running  ls /mnt in the docker container terminal you will get all the disks that were added (even ones that are not present in your system)
 
However Zabbix does not see those as drives and will not monitor them.
That's not the problem it's what happens to the share system

While knowing nothing about this app at all, I'd prefer if none of the drives were in the template and force the user to add them to lower problems elsewhere

Sent from my NSA monitored device

Link to comment
5 minutes ago, Squid said:

While knowing nothing about this app at all, I'd prefer if none of the drives were in the template and force the user to add them to lower problems elsewhere

I agree. And if you can't trust the user to know how to add them, then it doesn't make sense to trust them to not mess something else up elsewhere due to having all the additional /mnt folders. In fact, I would expect those additional /mnt folders to show up at various places in the webUI where users are expected to select a folder, such as setting up docker volume mappings.

Link to comment

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.