Posts tagged Zabbix

Enable SSH and SNMP on ESXi 5.1

8

This is a short tutorial on how to enable SNMP om your ESXi (v5.1) box the easy way, so you can add it in your favorite monitoring tools like Zabbix, Observium, PRTG, etc. You can do this on the console, but if your server is located in the data center and you don’t have KVM-access this will help you. First of all enable SSH on your box.

Enabling SSH on ESXi

  1. Connect with the vSphere client to your node
  2. Go to the configuration tab, then select Security Profile
  3. Select Properties with Services, then select SSH Server
  4. Click Options and select Start and Stop with host
  5. Click the Start button once to start the service for now

Opening the firewall to allow SSH connections

  1. Connect with the vSphere client to your node
  2. Go to the configuration tab, then select Security Profile
  3. Select Properties with Firewall, then select SSH Server
  4. Click SSH Server, select Firewall and allow an IP-range

You’ll get an annoying alert on the Summary tab of the vSphere client. To suppress this warning, go back to the Configuration tab and select Advanced Settings. Select UserVars and find UserVars.SuppressShellWarning. Set this value to 1. You’re done enabling SSH remotely. Now let’s configure SNMP.

To enable SNMP, SSH to your ESXi box. Windows users can use PuttY, Linux and Mac users the native Terminal. Log in as root@your.hostname.tld and enter the password. Paste these commands to the command-line of your ESXi box:

esxcli system snmp set -c public
esxcli system snmp set -l warning
esxcli system snmp set -e yes

That’s it. Both SSH and SNMP are enabled now.

Install Zabbix Agent on Synology

17

Since a few  months I use a Synology DS211 NAS device at home, to store my music, movies and back-ups. I also use Zabbix to monitor my servers, switches, etc. Since there is a Zabbix agent package for most Linux distributions, there was none for the Synology. But… Synology is Linux so let’s rock and compile them from source.

I assume that my readers are hard-core System Administrators who know how to enable SSH access and become root. The next thing to do is slipstream your Synology and install the ipkg package-manager. Now, install some build tools with the command:

DS> ipkg install gcc make bison flex gconv-modules

Let’s get the Zabbix source, in my case 1.9.3-beta, untar them and start compiling

DS> cd /root
DS> wget http://downloads.sourceforge.net/.../zabbix-1.9.3.tar.gz
DS> tar xzf zabbix-*
DS> cd zabbix-*
DS> ./configure --enable-agent --prefix=/opt/zabbix

The compiler starts running for a few minutes and shows this error:

(...)
checking for ICONV support... no
configure: error: Unable to find iconv.h "no"

Let’s see if the named file is on your system

DS> find / -name iconv.h
/volume1/@optware/include/iconv.h
/opt/include/iconv.h

The Zabbix configure script will look for the iconv.h file in /usr/include, not in /opt/include. Setting a symlink will fix this

DS> cd /usr/
DS> ln -s /opt/include/ include

Now start recompiling, you’ll see no more errors.

DS> cd /root/zabbix-*
DS> ./configure --enable-agent --prefix=/opt/zabbix
DS> make
DS> make install

Only thing left is creating configuration files and a init-script and a sample configuration file. Start Zabbix with from an SSH shell with “/opt/zabbix/sbin/zabbix_agentd -c /etc/zabbix/zabbix_agentd.conf &”

An sample /etc/zabbix/zabbix_agentd.conf:

PidFile=/tmp/zabbix_agentd.pid
LogFile=/opt/zabbix/agentd.log
Server=192.168.2.2 # Your Zabbix Server IP
Hostname=synology.domain.tld
Go to Top