Your ads will be inserted here by

Easy Plugin for AdSense.

Please go to the plugin admin page to
Paste your ad code OR
Suppress this ad slot.

While installating zabbix in centos there could be below given problems (May occur.)

Zabbix installation in CENTOS

checking for IKSEMEL... no
configure: error: Jabber library not found

solution : yum install iksemel-devel

Missing XMLWriter

yum install php-xml

checking for net-snmp-config... no
configure: error: Invalid NET-SNMP directory - unable to find net-snmp-config

yum install net-snmp-devel

yum install php-bcmath

PHP MB string	yes	 	 	Ok
if fail : isntall php-mbstring
could you face problem from php.ini

need to fix, date.timezone = "Europe/London"

default zabbix username and password for login is
Admin and password blank.

however if that creates problem.
update password,

USE zabbix;
UPDATE users SET passwd=md5(‘newpassword’) WHERE alias=’Admin’;

How to setup zabbix_proxy

Name: ashish.nepal.com
Groups : (Any wished)
DNS name : this should be same as Name, hostname in /zabbix_agentd.conf (in agent)
IP address : local ip (which is corresponding by proxy server)
monitored by proxy : proxy server name (should be in drop down).

/etc/zabbix/zabbix_agentd.conf

Hostname=same name as DNS name and name of server in GUI (Front end)
Server=internalip,zabbix_serverip

How to create trigger for Mysql Replication status in Zabbix

Show how many minutes slave is lagging behind Master

UserParameter=give.some.name,mysql -uzabbix -ppassword -e "SHOW SLAVE STATUSG" | grep Behind | cut -d ":" -f 2

Show if Slave sql is running Or Not

UserParameter=mysql.slave.lag,mysql -uzabbix -ppassword -e 'show slave statusG' | grep Slave_SQL_Running | awk '{print $2}' | sed 's/No/0/;s/Yes/1/'

How to Allow zabbix User to monitor rabbitmqctl

Your ads will be inserted here by

Easy Plugin for AdSense.

Please go to the plugin admin page to
Paste your ad code OR
Suppress this ad slot.

Userparameter to be added in rabbitmq server which is zabbix_agentd

vi /etc/zabbix/zabbix_agentd.conf

UserParameter should look like this if not exact.

UserParameter=mess.message.ready,sudo /usr/sbin/rabbitmqctl -n rabbit@servername list_queues name messages_ready | grep 'which-queue' | awk '{ print $2 }'
UserParameter=mess.queues.messages,sudo /usr/sbin/rabbitmqctl -n rabbit@servername list_queues name messages | grep 'which-queue' | awk '{ print $2 }'
UserParameter=mess.queues.memory,sudo /usr/sbin/rabbitmqctl -n rabbit@servername list_queues name messages | grep 'which-queue' | awk '{ print $2 }'

You would probably recieve error , as sudo is only allowed in TTY, if not using sudo, it would yeild Permission denied.

how to add user in sudo
visudo

%zabbix ALL=(ALL) NOPASSWD: /usr/sbin/rabbitmqctl
Defaults:%zabbix !requiretty
Defaults:zabbix !requiretty

(This is allow Default requiretty to exclude in for given senario)

cannot recreate Zabbix semaphores for IPC key

zabbix_agentd [8394]: Can’t recreate Zabbix semaphores for IPC key 0x7a028449 Semaphore ID 196608. Operation not permitted.

You should check ipcs and kill those with below given command, where it may vary, as awk $3 is username in the given senario

ipcs -s | awk ' $3 == "507" {print $2, $3}' | awk '{ print $1}' | while read i; do ipcrm sem $i; done

And you should restart rabbitmq-server and ctl, which might prompt you to node rabbit@….

Other useful parameter would be [RABBITMQ]

rabbitmqctl -n rabbit@server list_queues | grep -cv '...'
rabbitmqctl -n rabbit@server list_exchanges | grep -cv '...'
rabbitmqctl -n rabbit@server list_queues name durable | awk '{ print $2 }'
rabbitmqctl -n rabbit@server list_queues name messages_ready | awk '{ print $2 }'
rabbitmqctl -n rabbit@server list_queues name messages_unacknowledged | awk '{ print $2 }'
rabbitmqctl -n rabbit@server list_queues name messages | awk '{ print $2 }'
rabbitmqctl -n rabbit@server list_queues name consumers | awk '{ print $2 }'
rabbitmqctl -n rabbit@server list_queues name memory | awk '{ print $2 }'
rabbitmqctl -n rabbit@server list_exchanges name durable | awk '{ print $2 }'
rabbitmqctl -n rabbit@server list_exchanges name type | awk '{ print $2 }'

Memcached Monitoring using zabbix

UserParameter=memcached.stat.,echo -e "statsnquit" | nc 127.0.0.1 11211 | grep "STAT $2 " | awk '{print $$3}'
memcache.curr.connection,echo -e "statsnquit" | nc 127.0.0.1 11211 | grep "STAT $2" | grep "curr_connections" | awk '{print $3}'

Zabbix Real Time Data Log Count

Zabbix Log count Does not provide the real time output by simply doing tail with pipe command, however counting log file and simply gathering the change of number would provide accurate data.

wc -l logfile

And in zabbix UI, count as delta (simple change).

###########################################################

Script to write Userparameter In zabbix (Automated Script)

###########################################################

#!/bin/bash
rm -f /etc/zabbix/backup/zabbix_agentd.conf.*
cp /etc/zabbix/zabbix_agentd.conf /etc/zabbix/backup/zabbix_agentd.conf.`date +%s`
VAR=`grep -w "# Include=/etc/zabbix/zabbix_agentd.userparams.conf" /etc/zabbix/zabbix_agentd.conf`
RETVAL=$?
[ $RETVAL -eq 0 ] && sed -i 's/# Include=/etc/zabbix/zabbix_agentd.userparams.conf/ Include=/etc/zabbix/zabbix_agentd.userparams.conf/g' /etc/zabbix/zabbix_agentd.conf

RETVAL=$?
echo "$RETVAL"

echo "now"

if [ -f "/etc/zabbix/zabbix_agentd.userparams.conf" ]; then
    echo "User parameter File exists"


rm -f /etc/zabbix/backup/zabbix_agentd.userparams.conf.*
cp /etc/zabbix/zabbix_agentd.userparams.conf /etc/zabbix/backup/zabbix_agentd.userparams.conf.`date +%s`
echo "Userparameter=$1,$2" >> /etc/zabbix/zabbix_agentd.userparams.conf


else
        echo "There isnt any Userparameter.conf : Creating File"
                touch /etc/zabbix/zabbix_agentd.userparams.conf
                chown zabbix:zabbix /etc/zabbix/zabbix_agentd.userparams.conf

fi