Solaris 11 安装 Zabbix Agent

Solaris 11 安装 Zabbix Agent过程笔记。

root@ :~/ # more /etc/release
                          Oracle Solaris 11 11/11 SPARC
  Copyright (c) 1983, 2011, Oracle and/or its affiliates.  All rights reserved.
                            Assembled 18 October 2011
root@ :~/ #

# Get, unpack to root folder
cd
mkdir /root/zabbix
cd /root/zabbix
wget ftp://10.101.0.17/pub/kik/zabbix/zabbix_agents_2.0.6.solaris10.sparc.tar.gz -O /root/zabbix/zabbix_agents_2.0.6.solaris10.sparc.tar.gz
gunzip zabbix_agent*
tar -xvf zabbix_agent*
#wget ftp://my2950.momo.org/pub/kik/zabbix/zabbix_agents_2.0.6.solaris10.sparc.tar.gz
# Install binaries
cp bin/zabbix_* /usr/bin/
cp sbin/zabbix* /usr/sbin/
# Add user, group
groupadd -g 1221 zabbix
useradd -c 'Zabbix' -d / -g zabbix -s /usr/bin/false zabbix
# create config file
#/usr/local/etc/zabbix_agentd.conf
mkdir -p /etc/zabbix/conf.d
mkdir -p /usr/local/etc/
#echo "10.101.0.17 my2950.momo.org my2950" >> /etc/hosts
cat << EOF >/usr/local/etc/zabbix_agentd.conf
Hostname=$(hostname).$(domainname)
Server=10.111.0.17
Include=/etc/zabbix/conf.d/
PidFile=/var/run/zabbix/zabbix_agentd.pid
LogFile=/var/log/zabbix_agentd.log
LogFileSize=100
Timeout=30
EOF
# make pid, log files
mkdir /var/run/zabbix && chown zabbix:zabbix /var/run/zabbix
touch /var/log/zabbix_agentd.log && chown zabbix:zabbix /var/log/zabbix_agentd.log
cat << EOF >/var/svc/manifest/site/zabbix-agent.xml
<?xml version="1.0"?>
<!DOCTYPE service_bundle SYSTEM "/usr/share/lib/xml/dtd/service_bundle.dtd.1">
<service_bundle type="manifest">
        <service type="service" version="5">
                <create_default_instance enabled="false"/>
                <single_instance/>
                <dependency grouping="require_all" restart_on="none" type="service">
                        <service_fmri value="svc:/system/filesystem/local"/>
                </dependency>
                <exec_method type="method" exec="/usr/sbin/zabbix_agentd" timeout_seconds="60"/>
                <exec_method type="method" exec=":kill" timeout_seconds="60"/>
                <stability value="Unstable"/>
                <template>
                  <common_name>
                        <loctext xml:lang="C">Zabbix Agent</loctext>
                  </common_name>
                </template>
        </service>
</service_bundle>
EOF
svccfg import /var/svc/manifest/site/zabbix-agent.xml

root@ :~/ # svcs -a|grep zabbix
disabled      16:52:49 svc:/application/zabbix-agent:default
root@ :~/ # svcadm enable application/zabbix-agent
root@ :~/ # svcs -a|grep zabbix
online        16:54:05 svc:/application/zabbix-agent:default
root@ :~/ #

root@ :~/ # more /var/log/zabbix_agentd.log
  3897:20130620:165405.028 Starting Zabbix Agent [ ]. Zabbix 2.0.6 (revision 35158).
  3898:20130620:165405.039 agent #0 started [collector]
  3899:20130620:165405.040 agent #1 started [listener]
  3900:20130620:165405.041 agent #2 started [listener]
  3901:20130620:165405.042 agent #3 started [listener]
root@ :~/ #

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:http://www.heiqu.com/e12ceaf476b64d8d47d8f0019b67fb7f.html