Akamit Blog

Enterprise sysadmin's blog

  • You are here: 
  • Home
  • Installation and Upgrade

Zabbix agent package for Solaris 10

Posted on September 10th, 2010

Hi there!
We are going to create zabbix agent package and use it for installing large number of zabbix clients.
First, download the source package, unpack it and install to some location.
Let’s suppose the location would be /soft/build/zabbix-agent

gunzip -cd zabbix-1.8.3.tar.gz | tar xf -
cd zabbix-1.8.3
./configure --enable-agent --disable-server --prefix=/soft/build/zabbix-agent
make && make install

Now, copy Zabbix Solaris 10 package source files somewhere, for example to /soft/build/pkgsrc and execute make from there.

bash-2.05# make
echo "i pkginfo" > prototype
echo "i preinstall" >> prototype
echo "i postinstall" >> prototype
echo "i preremove" >> prototype
echo "i postremove" >> prototype
echo "i request" >> prototype
echo PKG=ZABagent > pkginfo
echo NAME=Zabbix agents >> pkginfo
echo ARCH=sparc >> pkginfo
echo VERSION=1.8.2 >> pkginfo
echo CATEGORY=system >> pkginfo
echo BASEDIR=/usr/local >> pkginfo
echo PSTAMP=\"`date '+%m/%d/%Y'`\" >> pkginfo
echo ZABBIX_SERVERS= >> pkginfo
echo SUNW_PKG_ALLZONES=false >> pkginfo
echo SUNW_PKG_THISZONE=true >> pkginfo
pkgproto /soft/build/zabbix-agent=/usr/local >> prototype
pkgmk -o -b /usr/local -r /
## Building pkgmap from package prototype file.
## Processing pkginfo file.
WARNING: missing directory entry for 
WARNING: parameter  set to "none"
## Attempting to volumize 14 entries in pkgmap.
part  1 -- 3784 blocks, 19 entries
## Packaging one part.
/var/spool/pkg/ZABagent/pkgmap
/var/spool/pkg/ZABagent/pkginfo
/var/spool/pkg/ZABagent/root/usr/local/bin/zabbix_get
/var/spool/pkg/ZABagent/root/usr/local/bin/zabbix_sender
/var/spool/pkg/ZABagent/root/usr/local/sbin/zabbix_agent
/var/spool/pkg/ZABagent/root/usr/local/sbin/zabbix_agentd
/var/spool/pkg/ZABagent/root/usr/local/share/man/man1/zabbix_get.1
/var/spool/pkg/ZABagent/root/usr/local/share/man/man1/zabbix_sender.1
/var/spool/pkg/ZABagent/root/usr/local/share/man/man8/zabbix_agentd.8
/var/spool/pkg/ZABagent/install/postinstall
/var/spool/pkg/ZABagent/install/postremove
/var/spool/pkg/ZABagent/install/preinstall
/var/spool/pkg/ZABagent/install/preremove
/var/spool/pkg/ZABagent/install/request
## Validating control scripts.
## Packaging complete.
pkgtrans /var/spool/pkg  Zabbix-agent-sol10-sparc.pkg ZABagent
Transferring  package instance
bash-2.05#

The package will be sitting in /var/spool/pkg. It made zone aware by defining 2 variables in pkginfo file:

SUNW_PKG_ALLZONES=false
SUNW_PKG_THISZONE=true

And will be installed only in zone you are running pkgadd from.

Install it. Example log output follows:

bash-3.00# pkgadd -d /var/tmp/Zabbix-agent-sol10-sparc.pkg 
 
The following packages are available:
  1  ZABagent     Zabbix agents
                  (sparc) 1.8.2
 
Select package(s) you wish to process (or 'all' to process
all packages). (default: all) [?,??,q]: 
 
Processing package instance  from 
## Installing package  in global zone
 
Zabbix agents(sparc) 1.8.2
Enter a zabbix server ip address [no more]:
This is not an IP address.
Enter a zabbix server ip address [no more]: 10.50.2.199
Enter a zabbix server ip address [no more]:
## Processing package information.
## Processing system information.
   1 package pathname is already properly installed.
## Verifying disk space requirements.
## Checking for conflicts with packages already installed.
 
The following files are already installed on the system and are being
used by another package:
  /usr/local 
  /usr/local/bin 
  /usr/local/sbin 
  /usr/local/share 
  /usr/local/share/man 
  /usr/local/share/man/man1 
 
Do you want to install these conflicting files [y,n,?,q] y
## Checking for setuid/setgid programs.
 
This package contains scripts which will be executed with super-user
permission during the process of installing this package.
 
Do you want to continue with the installation of  [y,n,?] y
 
Installing Zabbix agents as 
 
## Executing preinstall script.
## Installing part 1 of 1.
/usr/local/bin/zabbix_get
/usr/local/bin/zabbix_sender
/usr/local/sbin/zabbix_agent
/usr/local/sbin/zabbix_agentd
/usr/local/share/man/man1/zabbix_get.1
/usr/local/share/man/man1/zabbix_sender.1
/usr/local/share/man/man8/zabbix_agentd.8
[ verifying class  ]
## Executing postinstall script.
 
Installation of  was successful.
bash-3.00#

Package will create smf service and start it automatically. Check this out.

bash-3.00# svcs -a | grep zab
online         12:54:10 svc:/application/zabbix-agent:default
bash-3.00#

Next, we are going to automate installation process to avoid asking questions completely. We will use pkgask(1) command for that. First, we create response file which we can use later for automated install.

bash-3.00# pkgask -r /tmp/zab.ask -d /var/tmp/Zabbix-agent-sol10-sparc.pkg 
 
The following packages are available:
  1  ZABagent     Zabbix agents
                  (sparc) 1.8.2
 
Select package(s) you wish to process (or 'all' to process
all packages). (default: all) [?,??,q]: 
 
Processing package instance  from 
## Installing package  in global zone
 
Zabbix agents(sparc) 1.8.2
Enter a zabbix server ip address [no more]: 10.50.2.199
Enter a zabbix server ip address [no more]: 
 
Response file  was created.
 
Processing of request script was successful.

Next, create admin file. Copy sample from default to say /tmp and edit it.

cp /var/sadm/install/admin/default /tmp/zab.admin
vi !$

Make it not to ask anything. For example like this:

ail=
instance=unique
partial=ask
runlevel=ask
idepend=ask
rdepend=ask
space=ask
setuid=nocheck
conflict=nocheck
action=nocheck
networktimeout=60
networkretries=3
authentication=quit
keystore=/var/sadm/security
proxy=
basedir=default

And, finally, install the package using admin file and response file we just created.

bash-3.00# pkgadd -d /var/tmp/Zabbix-agent-sol10-sparc.pkg -r /tmp/zab.ask -a /tmp/zab.admin all
 
Processing package instance  from 
## Installing package  in global zone
 
Zabbix agents(sparc) 1.8.2
## Processing package information.
## Processing system information.
   7 package pathnames are already properly installed.
## Verifying disk space requirements.
 
Installing Zabbix agents as 
 
## Executing preinstall script.
## Installing part 1 of 1.
/usr/local/bin/zabbix_get
/usr/local/bin/zabbix_sender
/usr/local/sbin/zabbix_agent
/usr/local/sbin/zabbix_agentd
/usr/local/share/man/man1/zabbix_get.1
/usr/local/share/man/man1/zabbix_sender.1
/usr/local/share/man/man8/zabbix_agentd.8
[ verifying class  ]
## Executing postinstall script.
 
Installation of  was successful.

As you can see no questions was asked at all. So you can use the procedure to do mass installs of the package. You could also download Zabbix Solaris 10 binary package

made using using this instructions.

Tags:
Filed under Installation and Upgrade, Packages, Zabbix | 3 Comments »