Monday 30 January 2017

Easiest way to install zabbix agent on SLES 12 - SOLVED and EXPLAINDED!

You installed your new SUSE SLES 12 server and you want to install zabbix agent to that server. So whats the easiest way to install something on Linux? Of course by using package managment system! In this case this is zypper!

As you already know(or you will know now), zypper is easiest way to install, update or remove something from SLES. Why? Because it just works and will resolve all package dependensies!

So how to install zabbix agent on SLES 12 or 11? 

Suse create repository for zabbix! So all you need to do is to enable that repository and just install zabbix agent!

So here are steps to do that!

1. List you zypper repository on SLES
server:~ # zypper lr
# | Alias             | Name              | Enabled | GPG Check | Refresh
--+-------------------+-------------------+---------+-----------+--------
1 | SLES12-SP2_12.2-0 | SLES12-SP2 12.2-0 | Yes     | (r ) Yes  | No
2. add new repository for monitoring on SLES
server:~ # zypper addrepo http://download.opensuse.org/repositories/server:monitoring/SLE_12_SP2/server:monitoring.repo
Adding repository 'Server Monitoring Software (SLE_12_SP2)' ...................................................[done]
Repository 'Server Monitoring Software (SLE_12_SP2)' successfully added
Enabled     : Yes
Autorefresh : No
GPG Check   : Yes
Priority    : 99
URI         : http://download.opensuse.org/repositories/server:/monitoring/SLE_12_SP2/

3. list repository again to check if new repository is added
server:~ # zypper lr
# | Alias             | Name                                    | Enabled | GPG Check | Refresh
--+-------------------+-----------------------------------------+---------+-----------+--------
1 | SLES12-SP2_12.2-0 | SLES12-SP2 12.2-0                       | Yes     | (r ) Yes  | No
2 | server_monitoring | Server Monitoring Software (SLE_12_SP2) | Yes     | ( p) Yes  | No
server:~ # zypper refresh
Repository 'SLES12-SP2 12.2-0' is up to date.
Retrieving repository 'Server Monitoring Software (SLE_12_SP2)' metadata -----------------------------------------[\]

New repository or package signing key received:

  Repository:       Server Monitoring Software (SLE_12_SP2)
  Key Name:         server:monitoring OBS Project <server:monitoring@build.opensuse.org>
  Key Fingerprint:  8F3BC8EF F549CDCD A918D981 A5C23697 EE454F98
  Key Created:      Mon Jun 13 18:49:28 2016
  Key Expires:      Wed Aug 22 18:49:28 2018
  Rpm Name:         gpg-pubkey-ee454f98-575ee418


Do you want to reject the key, trust temporarily, or trust always? [r/t/a/? shows all options] (r): t
Retrieving repository 'Server Monitoring Software (SLE_12_SP2)' metadata ......................................[done]
Building repository 'Server Monitoring Software (SLE_12_SP2)' cache ...........................................[done]
All repositories have been refreshed.
4. Now just install zabbix agent on SLES by using zypper
server:~ # zypper install zabbix-agent
Loading repository data...
Reading installed packages...
Resolving package dependencies...

The following NEW package is going to be installed:
  zabbix-agent

The following package is not supported by its vendor:
  zabbix-agent

1 new package to install.
Overall download size: 182.2 KiB. Already cached: 0 B. After the operation, additional 648.1 KiB will be used.
Continue? [y/n/? shows all options] (y): y
Retrieving package zabbix-agent-2.2.16-1.1.x86_64                               (1/1), 182.2 KiB (648.1 KiB unpacked)
Retrieving: zabbix-agent-2.2.16-1.1.x86_64.rpm ................................................................[done]
Checking for file conflicts: ..................................................................................[done]
(1/1) Installing: zabbix-agent-2.2.16-1.1.x86_64 ..............................................................[done]
Additional rpm output:
warning: /var/cache/zypp/packages/server_monitoring/x86_64/zabbix-agent-2.2.16-1.1.x86_64.rpm: Header V3 DSA/SHA1 Sig                                                                                                                        nature, key ID ee454f98: NOKEY

And that is that!
After you installed zabbix agent on SLES you can remove repository because you dont need it anymore!