Author Archives: Al

Setting up Zabbix Agent to monitor CPU and HDD Temperatures

First turn off the firewall and disable selinux:
systemctl disable firewalld
vi /etc/selinux/config

Install the Zabbix 3.4 source repo and install zabbix and lm_sensros and smartmontools:
rpm -ivh
yum install -y zabbix-agent lm_sensors smartmontools

Edit /etc/zabbix/zabbix_agentd.conf and set the Server and ServerActive to the hostname of your zabbix server.

Create a sudoers.d file for zabbix in /etc/sudoers.d/zabbix:
zabbix ALL=NOPASSWD:/usr/sbin/smartctl
zabbix ALL=NOPASSWD:/bin/sensors

Create a new files in /etc/zabbix/zabbix_agentd.d called hdd_temps.conf and enter information like so:

Create the /usr/share/zabbix-agent directory and add hdd1, hdd2 and cpu1 shell scripts:
sudo smartctl -a /dev/sdb | grep Temperature_Celsius | awk {'print $10'}

sudo smartctl -a /dev/sdc | grep Temperature_Celsius | awk {'print $10'}

sudo sensors | grep Core | awk -F'[+|.]' {'print $2'}

In zabbix you need to add the items for HDD1, HDD2 and CPU1 to the configuration of the host. Once it is added zabbix will collect the date periodically.


Setting postgresql default database locale

UPDATE pg_database SET datallowconn = TRUE WHERE datname = 'template0';
UPDATE pg_database SET datistemplate = FALSE WHERE datname = 'template1';
drop database template1;
CREATE DATABASE template1 ENCODING = 'utf8' TEMPLATE = template0 LC_CTYPE ='en_US.utf8' LC_COLLATE = 'en_US.utf8';
UPDATE pg_database SET datistemplate = TRUE WHERE datname = 'template1';
UPDATE pg_database SET datallowconn = FALSE WHERE datname = 'template0';

Setting up mediasmartserverd for Centos 7 on EX490

This post details setting up mediasmartserverd under Centos 7 on an HP EX490. This allows for the status LED to be used as an indicator for updates and also the drive lights to be illuminated according to disk state/activity. The mediasmartserverd binary is built on the local machine:
yum -y install wget zip libudev-devel
yum -y groupinstall "Development Tools"
tar -zxvf 0.5.6.tar.gz
cd mediasmartserverd-0.5.6
cp mediasmartserverd /usr/local/sbin/
vi /usr/lib/systemd/system/mediasmartserverd.service

The enter the following into the file and exit with [Esc]:wq:


ExecStart=/usr/local/sbin/mediasmartserverd --activity --update-monitor


Then enable and start the service:
systemctl enable mediasmartserverd.service
systemctl start mediasmartserverd.service