2014. július 30., szerda

Citrix XenServer 6.2 Zabbix Agent installation

Install packages:

rpm -ivh http://repo.zabbix.com/zabbix/2.0/rhel/5/i386/zabbix-release-2.0-1.el5.noarch.rpm
rpm -ivh http://repo.zabbix.com/zabbix/2.0/rhel/5/i386/zabbix-2.0.12-1.el5.i386.rpm
rpm -ivh http://repo.zabbix.com/zabbix/2.0/rhel/5/i386/zabbix-agent-2.0.12-1.el5.i386.rpm

Add Zabbix agent to services:

echo -e "zabbix\t\t10050/tcp\t\t\t#Zabbix-Agent"  >> /etc/services

Enable the traffic (iptables rule)

lokkit
- customize
- other services: zabbix:tcp

Check whether the traffic is already enabled:

iptables-save  | grep 10050

Set the Zabbix server IP/DNS:

sed -i 's/Server=127.0.0.1/Server=monserver/' /etc/zabbix/zabbix_agentd.conf

Restart the agent:

/etc/init.d/zabbix-agent restart

Done

2014. január 5., vasárnap

Dlink DNS 323 fan always runs

I have a Dlink DNS 323 NAS with original firmware.
The device works great but sometimes the fan runs continously but no reason, because the temperature is not high.

When I login into the administration page and set the fan control to "always high" then save the configuration, the fan switch to maximum RPM.
After that I set the fan control to off/ low/high and save the config, the fan switchs off. After that the fan control works good for a period again.
It switch to low and switch off depending the temperature.

I've wrote a small script which can help me to resolve this issue. It can be run manually or with some modification from cron.

Here is the script:

#!/bin/bash

USER="admin"
echo -n "Admin pasword: "
read PASS
echo -n "NAS IP: "
read IP
echo "Logging in..."
wget -q --save-cookies cookies.txt --post-data 'f_LOGIN_NAME=$USER&f_LOGIN_PASSWD=$PASS&Config_Button=Configuration' http://$IP/goform/formLogin -O - > /dev/null
echo "Switch to high RPM"
wget -q --load-cookies cookies.txt --post-data 'f_onoff0=1&f_time=15&f_fan=2&power_onoff0=1' http://$IP/goform/SetPowerManagement -O - > /dev/null
echo "Wait a sec..."
sleep 1
echo "Switch off"
wget -q --load-cookies cookies.txt --post-data 'f_onoff0=1&f_time=15&f_fan=0&power_onoff0=1' http://$IP/goform/SetPowerManagement -O - > /dev/null
echo "Finished"
rm -f cookies.txt

Please feel free to use it.