{"id":319,"date":"2013-03-11T13:29:23","date_gmt":"2013-03-11T12:29:23","guid":{"rendered":"http:\/\/sam-soul.fr\/Info\/?p=319"},"modified":"2018-03-16T09:28:53","modified_gmt":"2018-03-16T08:28:53","slug":"install-zabbix-agent-linux-ubuntu-2","status":"publish","type":"post","link":"http:\/\/les-fougs.com\/wordpress\/2013\/03\/11\/install-zabbix-agent-linux-ubuntu-2\/","title":{"rendered":"Install zabbix agent Linux UBUNTU 1.8"},"content":{"rendered":"<p><strong>alias ll=&rsquo;ls -ltra&rsquo;<\/strong><\/p>\n<p>Installer le module de <a title=\"Compatibilit\u00e9 64 bits vs 32 bits\" href=\"http:\/\/sam-soul.fr\/Info\/compatibilite-64-bits-vs-32-bits\/\" target=\"_blank\" rel=\"noopener noreferrer\">Compatibilit\u00e9 64 bits vs 32 bits<\/a>. si besoin. apt-get install ia32-libs<\/p>\n<p>if necessary. <strong>apt-get install ia32-libs<\/strong><\/p>\n<p><strong>cat \/etc\/passwd<\/strong><\/p>\n<p><strong>adduser zabbix<\/strong><\/p>\n<p><strong>passwd\u00a0zabbixadm<\/strong><\/p>\n<p><strong>addgroup zabbix admin<br \/>\n<\/strong><\/p>\n<p>Si <span style=\"color: #ff0000;\">addgroup: The group `admin&rsquo; does not exist.<\/span> le groupe n&rsquo;esiste pas faire <strong>groupadd admin<\/strong><\/p>\n<p><strong>su &#8211; zabbix<\/strong><\/p>\n<p>cd \/home\/zabbix<\/p>\n<h2>download agent and server components, unpack:<\/h2>\n<p>&nbsp;<\/p>\n<p>scp zabbix@vlecm04p:zabbix-1.8.tar.gz .<br \/>\ntar zvpxf zabbix-1.8.tar.gz<\/p>\n<p>&#8212;&#8212;&#8211;<\/p>\n<p>&nbsp;<\/p>\n<p>scp zabbix@vlecm04p:zabbix_agents_1.8.linux2_6.i386.tar.gz .<br \/>\ntar zvpxf zabbix_agents_1.8.linux2_6.i386.tar.gz<\/p>\n<p><strong>exit <\/strong>(pour revenir sous le compte root)<\/p>\n<h2>Copy agent files and create needed directories:<\/h2>\n<p>cd \/home\/zabbix\/zabbix-1.8\/<br \/>\nmkdir \/etc\/zabbix mkdir \/var\/log\/zabbix<br \/>\nchown -R zabbix.zabbix \/etc\/zabbix\/<br \/>\nchown -R zabbix.zabbix \/var\/log\/zabbix<br \/>\ncp \/home\/zabbix\/zabbix-1.8\/misc\/conf\/zabbix_agent* \/etc\/zabbix\/<br \/>\ncp \/home\/zabbix\/zabbix-1.8\/bin\/zabbix_get \/usr\/bin\/<br \/>\ncp \/home\/zabbix\/zabbix-1.8\/bin\/zabbix_sender \/usr\/bin\/<br \/>\ncp \/home\/zabbix\/zabbix-1.8\/sbin\/zabbix_agent \/usr\/sbin\/<br \/>\ncp \/home\/zabbix\/zabbix-1.8\/sbin\/zabbix_agentd \/usr\/sbin\/<\/p>\n<h2>Edit zabbix agent configuration:<\/h2>\n<p>vi \/etc\/zabbix\/zabbix_agentd.conf<\/p>\n<pre>#make sure server ip is correct: \r\nLogFile=\/exploit\/logs\/zabbix_agentd.log\r\nLogFileSize=1\r\nDebugLevel=3\r\nServer=vmoni.ft.grp\r\nHostname=<em>nom_du_client<\/em>\r\nDisableActive=1\r\nUserParameter=system.topcpu[*],\/exploit\/scripts\/topcpu.sh $1\r\nUserParameter=zab_mem_free,\/exploit\/scripts\/zab_mem_free.sh\r\nUserParameter=zab_proc_mem[*],\/exploit\/scripts\/zab_proc_mem.sh $1\r\nUserParameter=zab_proc_cpu[*],\/exploit\/scripts\/zab_proc_cpu.sh $1<\/pre>\n<h2>R\u00e9cupration des scripts :<\/h2>\n<pre>scp root@vsch1.ft.grp:\/exploit\/scripts\/zab_m*.sh .\r\nscp root@vsch1.ft.grp:\/exploit\/scripts\/zab_p*.sh .\r\nscp root@vsch1.ft.grp:\/exploit\/scripts\/topcpu.sh .<\/pre>\n<h2>Edit Services file:<\/h2>\n<p>cat \/etc\/services|grep zabbix<\/p>\n<p><strong>vi \/etc\/services<\/strong><\/p>\n<pre>#Add the following rules at the end: \r\nzabbix_agent 10050\/tcp # Zabbix ports \r\nzabbix_trap 10051\/tcp # Zabbix ports<\/pre>\n<h2>Copy the init.d scripts:<\/h2>\n<p><strong>cp \/home\/zabbix\/zabbix-1.8\/misc\/init.d\/debian\/zabbix-agent \/etc\/init.d<\/strong><\/p>\n<h2>Edit the script files :<\/h2>\n<p><strong>vi \/etc\/init.d\/zabbix-agent<\/strong><\/p>\n<pre>#Change:\r\n #DAEMON=\/home\/zabbix\/bin\/${NAME}\r\n DAEMON=\/usr\/sbin\/${NAME}<\/pre>\n<h2>Set the correct permissions and set zabbix to start automatically:<\/h2>\n<p><strong>chmod 755 \/etc\/init.d\/zabbix-agent<\/strong><br \/>\n<strong>update-rc.d zabbix-agent defaults<\/strong><\/p>\n<h2>Stop \/ Start the agent:<\/h2>\n<p><strong>cd \/etc\/init.d<\/strong><\/p>\n<p><strong>vi zabbix_agent_start.sh<\/strong><\/p>\n<p>su -l zabbix -c \/usr\/sbin\/zabbix_agentd start<\/p>\n<p><strong>vi zabbix_agent_stop.sh<\/strong><\/p>\n<p>ps -ef | grep zabbix_agentd | grep -v grep | awk &lsquo;{print $2}&rsquo; | xargs kill -9<\/p>\n<p><strong>chmod 755 zabbix_agent_st*.sh<\/strong><\/p>\n<p><strong>cd \/etc\/rc3.d\/<\/strong><br \/>\n<strong>ln -s ..\/init.d\/zabbix_agent_stop.sh K20zabbix_agentd<\/strong><br \/>\n<strong>ln -s ..\/init.d\/zabbix_agent_start.sh S20zabbix_agentd<\/strong><\/p>\n<p><strong>cd \/etc\/rc5.d\/<\/strong><br \/>\n<strong>ln -s ..\/init.d\/zabbix_agent_stop.sh K20zabbix_agentd<\/strong><br \/>\n<strong>ln -s ..\/init.d\/zabbix_agent_start.sh S20zabbix_agentd<\/strong><\/p>\n<p>To stop zabbix agent<\/p>\n<p><strong>.\/K20zabbix_agentd<\/strong><\/p>\n<p>To start zabbix agent<\/p>\n<p><strong>.\/S20zabbix_agentd<\/strong><\/p>\n<p>Check if the Agent is running:<br \/>\n<strong>ps -aux | grep -v grep | grep zabbix_agentd<\/strong><br \/>\nzabbix 10302 0.0 0.0 3368 556 ? SN 14:32 0:00 \/usr\/sbin\/zabbix_agentd<br \/>\nzabbix 10303 0.4 0.0 3368 796 ? SN 14:32 0:00 \/usr\/sbin\/zabbix_agentd<br \/>\nzabbix 10304 0.0 0.0 3368 440 ? SN 14:32 0:00 \/usr\/sbin\/zabbix_agentd<br \/>\nzabbix 10305 0.0 0.0 3368 440 ? SN 14:32 0:00 \/usr\/sbin\/zabbix_agentd<br \/>\nzabbix 10306 0.0 0.0 3368 440 ? SN 14:32 0:00 \/usr\/sbin\/zabbix_agentd<br \/>\nzabbix 10307 0.0 0.0 3404 840 ? SN 14:32 0:00 \/usr\/sbin\/zabbix_agentd<br \/>\nzabbix 10323 0.0 0.0 7528 892 pts\/1 R+ 14:32 0:00 grep zabbix_agent<\/p>\n<h2>Test the proper operation of the agent<\/h2>\n<p>Connect on<strong> vmoni<\/strong> with root account<\/p>\n<p>cd \/usr\/local\/bin<\/p>\n<p>root@vmoni:~# <strong>zabbix_get -p 10050 -k agent.version -s<\/strong> <em>servername<\/em><\/p>\n<p>1.8<\/p>\n<p>Must return the version of the zabbix agent.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>alias ll=&rsquo;ls -ltra&rsquo; Installer le module de Compatibilit\u00e9 64 bits vs 32 bits. si besoin. apt-get install ia32-libs if necessary. apt-get install ia32-libs cat \/etc\/passwd adduser zabbix passwd\u00a0zabbixadm addgroup zabbix admin Si addgroup: The group `admin&rsquo; does not exist. le groupe n&rsquo;esiste pas faire groupadd admin su &#8211; zabbix cd \/home\/zabbix download agent and server &hellip; <a href=\"http:\/\/les-fougs.com\/wordpress\/2013\/03\/11\/install-zabbix-agent-linux-ubuntu-2\/\" class=\"more-link\">Continuer la lecture<span class=\"screen-reader-text\"> de &laquo;&nbsp;Install zabbix agent Linux UBUNTU 1.8&nbsp;&raquo;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[52,47],"tags":[],"_links":{"self":[{"href":"http:\/\/les-fougs.com\/wordpress\/wp-json\/wp\/v2\/posts\/319"}],"collection":[{"href":"http:\/\/les-fougs.com\/wordpress\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/les-fougs.com\/wordpress\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/les-fougs.com\/wordpress\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/les-fougs.com\/wordpress\/wp-json\/wp\/v2\/comments?post=319"}],"version-history":[{"count":6,"href":"http:\/\/les-fougs.com\/wordpress\/wp-json\/wp\/v2\/posts\/319\/revisions"}],"predecessor-version":[{"id":1950,"href":"http:\/\/les-fougs.com\/wordpress\/wp-json\/wp\/v2\/posts\/319\/revisions\/1950"}],"wp:attachment":[{"href":"http:\/\/les-fougs.com\/wordpress\/wp-json\/wp\/v2\/media?parent=319"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/les-fougs.com\/wordpress\/wp-json\/wp\/v2\/categories?post=319"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/les-fougs.com\/wordpress\/wp-json\/wp\/v2\/tags?post=319"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}