Installing Zabbix Agent on Solaris 11 |
Solaris is an operating system that is showing its age. Despite version 11 support will last untill November 2034, Oracle is not showing interest in releasing a new version. Due to this reason Solaris developers and systen administradors are migrating to Linux (check this post writen by Brendan Greeg, the author of many ZFS algorithms).
So why am I sharing this knowledge once Solaris is almost a retired operating system? Well, as I said before, its support will still last untill the end of 2034 and yes, you may suddenly come across a server running Solaris and have no idea how to deal with. Netflix is an example of a company that runs a solaris-based operating system on its servers (of course, there are more than just Solaris running there. You may find different types of Linux distribution, FreeBSD and Windows on Netflix servers).
Image taken from Netflix Blog |
- There is no Zabbix Agent 2 for Solaris. Sabbix Agent 2 is a new version writen in Go language (with some code writen in C language reused from Zabbix Agent) to be more flexible by using plugins. This version was not developed for Solaris.
- There are two different types os pakages to download. One is a tar.gz file containing Zabbix binaries. The other one is a P5P pakage.
So wich one to use? I would like to analise the tar.gz file first because this one is a little more complicated. As you can see on the image bellow this is not a gzip file; actually it is just a tar file, so I had only to use tar -xvf and not with the z option to decompress it.
By decompressing the tar.gz file, you will get three binaries; the zabbix_agentd, the zabbix_get and the zabbix_sender.
This is a image from my home computer because I forgot to print this situation |
OK, now we have he binaries BUT where do I put it? This is a simple question BUT, where are the configuration files? At first we thought the .tar.gz was goig to be easier to work with. That's why we decided to download the .p5p file and use the pakage manager to install it.
To install a p5p pakage you have to put it in Solaris list by typing pkg list -f -g and selecting the pakage through its path. By the, keep its name listed on the NAME (PUBLISHER) field because you will need it.
After putting it in Solaris list, now you are able to install it by typing pkg install -f the path of the pakage AND the name listed on the NAME (PUBLISHER) field. If you don't indicate the pakage name, the pakage manager will return a error message.
Now we have our next problem: where are the binaries installed? This is the simplest question. The haredest one is where are the configuration files? I had to use the find command to find them all then I discovered that Zabbix Agent is installed under /opt/zabbix-agent (which is something that makes sense if we follow the FHS rules) and the configuration files are under /etc/opt/zabbix-agent.
PATH variable on Solaris |
PATH variable on Linux |
First problem solve and after editing the /etc/opt/zabbix-agent/zabbix_agentd.conf now we have to solve the next problem: The Zabbix init scrip. Zabbix for Solaris doesn't come with a init script as you can see on the picture bellow.
If it doesn't get a init script, how do i start os stop Zabbix process? The answer for this question is the zabbix_agentd command. To start the Zabbix agent process you have to run zabbix_agentd -c /etc/zabbix-agent/zabbix_agentd.conf command (yes, this is the syntax to start zabbix agent...)
Starting Zabbix agent on Solaris |
Then, I worked on a init script like this. But here was a problem on my script. Now that I know how to start Zabbix Agent on Solaris, how do stop it if I need to? That was a really interesting point because the zabbix_agentd doesn't support this feature. So, how do I do this?
My Solaris Zabbix Agent init script |
svcbundle -o zabbix-agentd.xml -s service-name=application/zabbix-agentd -s model=daemon -s start-method="/usr/local/sbin/zabbix_agentd"
Then we have to Import the manifest running:
svccfg import misc/solaris/11/zabbix-agentd.xml
To start/stop/restart Zabbix Agent, now we only need to run:
svcadm enable/disable/restart zabbix-agentd
So, I could only donwload the tar file, decompress it, copy the files to /bin, create the zabbix user and zabbix group and then generate the SMF manifest. I hope this becomes useful for you if this situation
Install Zabbix Agent on solaris 10
support zabbix
server init script for Solaris
Zabbix Agent in Solaris
launchd info
Solaris smf manifest
Nenhum comentário:
Postar um comentário