hp-ux 11.23安装 zabbix agent
bash-4.1# ls -l
total 6320
-rw-r--r-- 1 root sys 3230902 Oct 30 16:18 zabbix_agents_2.4.0.hpux11_23.ia64.tar.gz
bash-4.1#
bash-4.1# /usr/contrib/bin/gunzip zabbix_agents_2.4.0.hpux11_23.ia64.tar.gz
bash-4.1# ls -l
total 10608
-rw-r--r-- 1 root sys 5427200 Oct 30 16:18 zabbix_agents_2.4.0.hpux11_23.ia64.tar
bash-4.1# tar -xvf zabbix_agents_2.4.0.hpux11_23.ia64.tar
x sbin/zabbix_agent, 1444580 bytes, 2822 tape blocks
x sbin/zabbix_agentd, 1537980 bytes, 3004 tape blocks
x bin/zabbix_get, 1191640 bytes, 2328 tape blocks
x bin/zabbix_sender, 1229364 bytes, 2402 tape blocks
x conf/zabbix_agent.conf, 2537 bytes, 5 tape blocks
x conf/zabbix_agentd.conf, 7797 bytes, 16 tape blocks
x conf/zabbix_agentd/userparameter_examples.conf, 1359 bytes, 3 tape blocks
x conf/zabbix_agentd/userparameter_mysql.conf, 1517 bytes, 3 tape blocks
bash-4.1#
bash-4.1# pwd
/root/zabbix
bash-4.1# ls
bin sbin
conf zabbix_agents_2.4.0.hpux11_23.ia64.tar
bash-4.1# ./sbin/zabbix_agentd -V
Zabbix Agent (daemon) v2.4.0 (revision 48857) (11 September 2014)
Compilation time: Sep 10 2014 21:14:18
bash-4.1#
bash-4.1# groupadd -g 122 zabbix
bash-4.1# useradd -c 'zabbix agent' -s /usr/bin/false zabbix
bash-4.1# mkdir -p /etc/zabbix/conf.d
bash-4.1# cat << EOF >/etc/zabbix/zabbix_agentd.conf
> HostnameItem=system.hostname
> ServerActive=10.101.0.17
> Server=10.101.0.17
> Include=/etc/zabbix/conf.d/
> PidFile=/tmp/zabbix_agentd.pid
> LogFile=/tmp/zabbix_agentd.log
> LogFileSize=100
> Timeout=30
> EOF
bash-4.1#
bash-4.1# cp -p bin/* /usr/bin/
bash-4.1# cp -p sbin/* /usr/sbin/
bash-4.1#
bash-4.1# more /etc/rc.config.d/zabbixd
#!/sbin/sh
# v1.0 zabbixd startup/kill config
# ZABBIXD: Set to 1 to start
ZABBIXD=1
bash-4.1#
bash-4.1# vi /sbin/init.d/zabbixd
#!/sbin/sh
PATH=$PATH:/etc/zabbix
export PATH
PIDFILE=/tmp/zabbix_agentd.pid
rval=0
set_return() {
x=$?
if [ $x -ne 0 ]; then
echo "EXIT CODE: $x"
rval=1 # script FAILed
fi
}
killproc() {
pid=`ps -el | awk '( ($NF ~ /'"$1"'/) && ($4 != mypid) && ($5 != mypid) ){ print $4 }' mypid=$$ `
if [ "X$pid" != "X" ]; then
if kill "$pid"; then
echo "$1 stopped"
else
rval=1
echo "Unable to stop $1"
fi
fi
}
case $1 in
'start_msg')
echo "Starting the Zabbix"
;;
'stop_msg')
echo "Stopping the Zabbix"
;;
'start')
if [ -f /etc/rc.config ] ; then
. /etc/rc.config
else
echo "ERROR: /etc/rc.config defaults file MISSING"
fi
# Check to see if this script is allowed to run...
if [ "$ZABBIXD" != 1 ]; then
rval=2
else
# Execute the commands to start your subsystem
/usr/sbin/zabbix/zabbix_agentd -c /etc/zabbix/zabbix_agentd.conf
fi
;;
'stop')
# source the system configuration variables
if [ -f /etc/rc.config ] ; then
. /etc/rc.config
else
echo "ERROR: /etc/rc.config defaults file MISSING"
fi
# Check to see if this script is allowed to run...
if [ "$ZABBIXD" != 1 ]; then
rval=2
else
# Execute the commands to stop your subsystem
if [ -f $PIDFILE ] ; then
kill `cat ${PIDFILE}`
if [ -f $PIDFILE ] ; then
rm $PIDFILE;
fi
fi
fi
;;
*)
echo "usage: $0 {start|stop|start_msg|stop_msg}"
rval=1
;;
esac
exit $rval
bash-4.1# ln -s /sbin/init.d/zabbixd /sbin/rc3.d/S900zabbixd
bash-4.1# ln -s /sbin/init.d/zabbixd /sbin/rc2.d/K100zabbixd
bash-4.1#
bash-4.1# chmod 744 /sbin/init.d/zabbixd
bash-4.1# /sbin/init.d/zabbixd start
bash-4.1#
bash-4.1# ps -eaf|grep zabbix
zabbix 26140 26136 0 16:47:36 ? 0:00 /usr/sbin/zabbix_agentd: listener #3 [waiting for connection]
zabbix 26139 26136 0 16:47:36 ? 0:00 /usr/sbin/zabbix_agentd: listener #2 [waiting for connection]
zabbix 26137 26136 0 16:47:36 ? 0:00 /usr/sbin/zabbix_agentd: collector [idle 1 sec]
zabbix 26136 1 0 16:47:36 ? 0:00 /usr/sbin/zabbix_agentd -c /etc/zabbix/zabbix_agentd.conf
zabbix 26138 26136 0 16:47:36 ? 0:00 /usr/sbin/zabbix_agentd: listener #1 [waiting for connection]
zabbix 26141 26136 0 16:47:36 ? 0:00 /usr/sbin/zabbix_agentd: active checks #1 [getting list of active checks]
root 26151 25811 0 16:47:41 pts/tb 0:00 grep zabbix
bash-4.1#
bash-4.1# more /tmp/zabbix_agentd.log
26136:20141030:164736.874 Starting Zabbix Agent [HPITA]. Zabbix 2.4.0 (revision 48857).
26136:20141030:164736.874 using configuration file: /etc/zabbix/zabbix_agentd.conf
26136:20141030:164736.879 agent #0 started [main process]
26137:20141030:164736.880 agent #1 started [collector]
26138:20141030:164736.881 agent #2 started [listener #1]
26139:20141030:164736.881 agent #3 started [listener #2]
26140:20141030:164736.882 agent #4 started [listener #3]
26141:20141030:164736.882 agent #5 started [active checks #1]
26141:20141030:164741.947 no active checks on server [10.101.0.17:10051]: host [HPITA] not found
bash-4.1#
测试一下
[root@my2950 ~]# zabbix_get -s 10.101.0.66 -k system.uname
HP-UX
[root@my2950 ~]#
阅读(3853) | 评论(1) | 转发(0) |