个人工具

“UbuntuHelp:Zenoss”的版本间的差异

来自Ubuntu中文

跳转至: 导航, 搜索
 
(未显示同一用户的4个中间版本)
第4行: 第4行:
 
Installing [http://www.zenoss.com/ Zenoss] network monitor on a Ubuntu Server. Dapper (150mb) and Zenoss (232mb) minimum requirements: 382mb ram, 1400mb disk (900mb used, 500mb free for data). This install tested on vmware server 1.0.1.
 
Installing [http://www.zenoss.com/ Zenoss] network monitor on a Ubuntu Server. Dapper (150mb) and Zenoss (232mb) minimum requirements: 382mb ram, 1400mb disk (900mb used, 500mb free for data). This install tested on vmware server 1.0.1.
 
== Installation ==
 
== Installation ==
1. Install LAMP server from Ubuntu server CD <br>
+
1. Install LAMP server from Ubuntu server CD <<BR>>
2. Login as default user. Install ssh so you can putty (remote terminal) from your desktop:  
+
2. Login as default user. Install ssh so you can putty (remote terminal) from your desktop: <pre><nowiki>
<pre><nowiki>
+
 
sudo apt-get install ssh
 
sudo apt-get install ssh
 
ifconfig | grep cast (to see what your IP is) </nowiki></pre>
 
ifconfig | grep cast (to see what your IP is) </nowiki></pre>
3. Putty in and login as default user. Activate root login - required for zenoss and so we don’t have to “sudo” everything:  
+
3. Putty in and login as default user. Activate root login - required for zenoss and so we don’t have to “sudo” everything: <pre><nowiki>
<pre><nowiki>
+
 
sudo passwd root    (give new password for root)
 
sudo passwd root    (give new password for root)
 
su </nowiki></pre>
 
su </nowiki></pre>
4. Need to add universe for apt-get use (svn, mysql dev) (using nano for editor):  
+
4. Need to add universe for apt-get use (svn, mysql dev) (using nano for editor): <pre><nowiki>
<pre><nowiki>
+
 
nano /etc/apt/sources.list
 
nano /etc/apt/sources.list
 
      (uncomment these two lines by removing #)
 
      (uncomment these two lines by removing #)
第21行: 第18行:
 
      (save file, then refresh at command prompt)
 
      (save file, then refresh at command prompt)
 
apt-get update </nowiki></pre>
 
apt-get update </nowiki></pre>
5. Update to latest Ubuntu:  
+
5. Update to latest Ubuntu: <pre><nowiki>
<pre><nowiki>
+
 
apt-get upgrade </nowiki></pre>
 
apt-get upgrade </nowiki></pre>
6. Install make, mysql, python development tools for Zenoss. Note that the mysql dev version number is different for each mysql release. The “15” version below is for mysql 5.0.x. Easy way to find your version is run “/etc/init.d/mysql status” . Go to http://packages.ubuntu.com to check for correct package.  
+
6. Install make, mysql, python development tools for Zenoss. Note that the mysql dev version number is different for each mysql release. The “15” version below is for mysql 5.0.x. Easy way to find your version is run “/etc/init.d/mysql status” . Go to http://packages.ubuntu.com to check for correct package. Since Zenoss 2.1.2 requires python 2.4, you may need to install python2.4-dev instead of python-dev. <pre><nowiki>
<pre><nowiki>
+
 
apt-get install build-essential autoconf swig
 
apt-get install build-essential autoconf swig
 
apt-get install libmysqlclient15-dev
 
apt-get install libmysqlclient15-dev
 
apt-get install python-dev </nowiki></pre>
 
apt-get install python-dev </nowiki></pre>
7. Ubuntu server installs using DHCP – we should be using a static IP:  
+
7. Ubuntu server installs using DHCP – we should be using a static IP: <pre><nowiki>
<pre><nowiki>
+
 
nano /etc/network/interfaces
 
nano /etc/network/interfaces
 
iface eth0 inet dhcp          - change this line to the following (assume 192.168.3.10)
 
iface eth0 inet dhcp          - change this line to the following (assume 192.168.3.10)
第39行: 第33行:
 
        broadcast 192.168.3.255
 
        broadcast 192.168.3.255
 
        gateway 192.168.3.1 </nowiki></pre>
 
        gateway 192.168.3.1 </nowiki></pre>
8. Edit /etc/hosts file for your new IP address. Assuming you named the server “zenoss” and running in “mydomain.inc”, change the second 127.0.0.1 to:  
+
8. Edit /etc/hosts file for your new IP address. Assuming you named the server “zenoss” and running in “mydomain.inc”, change the second 127.0.0.1 to: <pre><nowiki>
<pre><nowiki>
+
 
192.168.3.10  zenoss.mydomain.inc  zenoss </nowiki></pre>
 
192.168.3.10  zenoss.mydomain.inc  zenoss </nowiki></pre>
9. Restart the network:  
+
9. Restart the network: <pre><nowiki>
<pre><nowiki>
+
 
/etc/init.d/networking restart </nowiki></pre>
 
/etc/init.d/networking restart </nowiki></pre>
10. Add zenoss user:  
+
 
<pre><nowiki>
+
10. Add zenoss user: <pre><nowiki>
 
adduser zenoss </nowiki></pre>
 
adduser zenoss </nowiki></pre>
11. Add zenoss install directory:  
+
11. Add zenoss install directory: <pre><nowiki>
<pre><nowiki>
+
 
mkdir /usr/local/zenoss
 
mkdir /usr/local/zenoss
 
chown zenoss /usr/local/zenoss </nowiki></pre>
 
chown zenoss /usr/local/zenoss </nowiki></pre>
12. Login as zenoss user and set up some variables in login script:  
+
12. Login as zenoss user and set up some variables in login script: <pre><nowiki>
<pre><nowiki>
+
 
su zenoss
 
su zenoss
 
cd        (goto home directory)
 
cd        (goto home directory)
第61行: 第51行:
 
  export PYTHONPATH=$ZENHOME/lib/python
 
  export PYTHONPATH=$ZENHOME/lib/python
 
  export PATH=$ZENHOME/bin:$PATH </nowiki></pre>
 
  export PATH=$ZENHOME/bin:$PATH </nowiki></pre>
13. Some zenoss daemons require root access, so add zenoss to sudo users. Login as root:  
+
13. Some zenoss daemons require root access, so add zenoss to sudo users. Login as root: <pre><nowiki>
<pre><nowiki>
+
 
visudo (loads sudo editor – nano in this case - add the following 2 lines)
 
visudo (loads sudo editor – nano in this case - add the following 2 lines)
 
  zenoss monitor = NOPASSWD: /usr/local/zenoss/bin/*,/bin/kill
 
  zenoss monitor = NOPASSWD: /usr/local/zenoss/bin/*,/bin/kill
 
  Defaults env_keep += "PYTHONPATH ZENHOME" </nowiki></pre>
 
  Defaults env_keep += "PYTHONPATH ZENHOME" </nowiki></pre>
14. Zenoss requires the mysql root password to be not blank (default), so we need to change the mysql password. Login as root:  
+
14. Zenoss requires the mysql root password to be not blank (default), so we need to change the mysql password. Login as root: <pre><nowiki>
<pre><nowiki>
+
 
/etc/init.d/mysql stop (stop mysql)
 
/etc/init.d/mysql stop (stop mysql)
 
nano mysql-init (create a new file and enter this line:)
 
nano mysql-init (create a new file and enter this line:)
第74行: 第62行:
 
/etc/init.d/mysql start  (start mysql)
 
/etc/init.d/mysql start  (start mysql)
 
rm mysql-init </nowiki></pre>
 
rm mysql-init </nowiki></pre>
15. Get latest zenoss tarball from this [http://www.zenoss.com/download download link]. I don't recommend using subversion to download since it gets the latest beta release, not the stable release. To use svn need to download svn first from universe. Login as root::  
+
15. Get latest zenoss tarball from this [http://www.zenoss.com/download download link]. I don't recommend using subversion to download since it gets the latest beta release, not the stable release. To use svn need to download svn first from universe. Login as root:: <pre><nowiki>
<pre><nowiki>
+
 
apt-get install svn-buildpackage  (only if svn needed)
 
apt-get install svn-buildpackage  (only if svn needed)
 
su zenoss (login as zenoss)
 
su zenoss (login as zenoss)
 
cd (change to /home/zenoss)
 
cd (change to /home/zenoss)
(do either)
+
                        (do either)
wget http://easynews.dl.sourceforge.net/sourceforge/zenoss/zenoss-9.99.9.tar.gz
+
        wget http://easynews.dl.sourceforge.net/sourceforge/zenoss/zenoss-9.99.9.tar.gz
tar -xzf zenoss*.gz
+
        tar -xzf zenoss*.gz
(or this)
+
                        (or this)
 
svn co http://dev.zenoss.org/svn/trunk/inst zenossinst (download latest beta to zenossinst subdir) </nowiki></pre>
 
svn co http://dev.zenoss.org/svn/trunk/inst zenossinst (download latest beta to zenossinst subdir) </nowiki></pre>
16. Install zenoss from its install directory. For mysql, use the default root user, with the password you used in step 14. For zenoss password, create a new one:  
+
16. Install zenoss from its install directory. For mysql, use the default root user, with the password you used in step 14. For zenoss password, create a new one: <pre><nowiki>
<pre><nowiki>
+
 
cd zenoss*
 
cd zenoss*
 
./install.sh (cross your fingers)
 
./install.sh (cross your fingers)
zenoss restart </nowiki></pre>
+
        zenoss restart </nowiki></pre>
17. If install fails, cleanup with:  
+
17. If install fails, cleanup with: <pre><nowiki>
<pre><nowiki>
+
 
make clean </nowiki></pre>
 
make clean </nowiki></pre>
18. If install says successful, browse the zenoss portal  
+
18. If install says successful, browse the zenoss portal <pre><nowiki>
<pre><nowiki>
+
 
Go to http:// 192.168.3.10:8080/zport/dmd
 
Go to http:// 192.168.3.10:8080/zport/dmd
 
Username is "admin"
 
Username is "admin"
 
Password is the one entered for Zenoss "admin" user in step 16 </nowiki></pre>
 
Password is the one entered for Zenoss "admin" user in step 16 </nowiki></pre>
19. To monitor your zenoss server, install SNMP agent. After installing, you need to configure it to allow ‘public’ to read all OIDs (default is to read very few OIDs):  
+
19. To monitor your zenoss server, install SNMP agent. After installing, you need to configure it to allow ‘public’ to read all OIDs (default is to read very few OIDs): <pre><nowiki>
<pre><nowiki>
+
 
apt-get install snmpd
 
apt-get install snmpd
 
cp /etc/snmp/snmpd.conf  /etc/snmp//snmpd.conf.bak
 
cp /etc/snmp/snmpd.conf  /etc/snmp//snmpd.conf.bak
第104行: 第87行:
 
cp snmpd.conf  /etc/snmp/
 
cp snmpd.conf  /etc/snmp/
 
/etc/init.d/snmpd restart </nowiki></pre>
 
/etc/init.d/snmpd restart </nowiki></pre>
20. Default ubuntu mail agent (MTA) is exim4, which may need to be setup if you want email alerts to work with a remote mail server (mail.mydomain.inc):  
+
20. Default ubuntu mail agent (MTA) is exim4, which may need to be setup if you want email alerts to work with a remote mail server (mail.mydomain.inc): <pre><nowiki>
<pre><nowiki>
+
 
dpkg-reconfigure exim4-config (select default options, except for below)
 
dpkg-reconfigure exim4-config (select default options, except for below)
 
mail sent by smarthost; received via SMTP or fetchmail
 
mail sent by smarthost; received via SMTP or fetchmail
 
mail.mydomain.inc </nowiki></pre>
 
mail.mydomain.inc </nowiki></pre>
21. To test mail agent, need to install a frontend (MUA - mail) to exim4:  
+
21. To test mail agent, need to install a frontend (MUA - mail) to exim4: <pre><nowiki>
<pre><nowiki>
+
 
apt-get install mailutils
 
apt-get install mailutils
  
第117行: 第98行:
 
.  (type in single period, then enter, to end composing and email is queued)
 
.  (type in single period, then enter, to end composing and email is queued)
 
mailq (to see if mail is sent or still in queue) </nowiki></pre>
 
mailq (to see if mail is sent or still in queue) </nowiki></pre>
22. For Windows monitoring, install SNMP from add/remove Windows monitoring components, then install [http://www.snmp-informant.com SNMP-Informant] – download the free SNMP for Windows. <br>
+
22. For Windows monitoring, install SNMP from add/remove Windows monitoring components, then install [http://www.snmp-informant.com SNMP-Informant] – download the free SNMP for Windows. <<BR>>
23. Read the [http://www.zenoss.com/download/ Zenoss Admin guide] <br>
+
23. Read the [http://www.zenoss.com/download/ Zenoss Admin guide] <<BR>>
24. To add zenoss daemons to run at boot up, login as root. Apached runtime is 90, so we use 95 to have it run after it and mysql. Also need to modify zenoss script for ZENHOME path:  
+
24. To add zenoss daemons to run at boot up, login as root. Apached runtime is 90, so we use 95 to have it run after it and mysql. Also need to modify zenoss script for ZENHOME path: <pre><nowiki>
<pre><nowiki>
+
 
cp $ZENHOME/bin/zenoss  /etc/init.d  
 
cp $ZENHOME/bin/zenoss  /etc/init.d  
 
nano  /etc/init.d/zenoss
 
nano  /etc/init.d/zenoss
第126行: 第106行:
 
    export ZENHOME=/usr/local/zenoss
 
    export ZENHOME=/usr/local/zenoss
 
update-rc.d zenoss 95 </nowiki></pre>
 
update-rc.d zenoss 95 </nowiki></pre>
25. Thanks to the following useful ubuntu / mysql / zenoss sites: <br>
+
== Troubleshooting ==
http://www.howtoforge.com/perfect_setup_ubuntu_6.06 <br>
+
=== no snmp found for ip ===
http://ubuntuguide.org/wiki/Ubuntu_dapper <br>
+
If you get "no snmp found for ip" error on running zendisc or adding a device, edit /etc/default/snmpd and remove 127.0.0.1 from this line:
http://packages.ubuntu.com <br>
+
# snmpd options (use syslog, close stdin/out/err).
http://dev.mysql.com/doc/refman/5.0/en/resetting-permissions.html <br>
+
SNMPDOPTS='-Lsd -Lf /dev/null -u snmp -I -smux -p /var/run/snmpd.pid 127.0.0.1'
http://www.zenoss.com/download/install <br>
+
Then restart snmpd.
 +
=== snmpwalk ===
 +
If you need snmpwalk command, install the tinysnmp-agent package.
 +
== See also ==
 +
* [[UbuntuHelp:Nagios|Nagios]], [[UbuntuHelp:Nagios2|Nagios2]]
 +
== External links ==
 +
Thanks to the following useful ubuntu / mysql / zenoss sites:
 +
* [http://www.zenoss.com/community/docs Zenoss Documentation]
 +
* [http://www.howtoforge.com/zenoss_network_monitor_ubuntu Installing Zenoss Network Monitor on a Ubuntu Server]
 
----
 
----
[[category:CategoryDocumentation]]
+
[[category:CategoryNetworking]]
  
 
[[category:UbuntuHelp]]
 
[[category:UbuntuHelp]]

2008年10月20日 (一) 01:22的最新版本

Introduction

Installing Zenoss network monitor on a Ubuntu Server. Dapper (150mb) and Zenoss (232mb) minimum requirements: 382mb ram, 1400mb disk (900mb used, 500mb free for data). This install tested on vmware server 1.0.1.

Installation

1. Install LAMP server from Ubuntu server CD <
>

2. Login as default user. Install ssh so you can putty (remote terminal) from your desktop:
	sudo apt-get install ssh
	ifconfig | grep cast		(to see what your IP is) 
3. Putty in and login as default user. Activate root login - required for zenoss and so we don’t have to “sudo” everything:
	sudo passwd root    (give new password for root)
	su 
4. Need to add universe for apt-get use (svn, mysql dev) (using nano for editor):
	nano /etc/apt/sources.list
	      (uncomment these two lines by removing #)
	    deb http://ca.archive.ubuntu.com/ubuntu/ dapper universe
	    deb-src http://ca.archive.ubuntu.com/ubuntu/ dapper universe
	      (save file, then refresh at command prompt)
	apt-get update 
5. Update to latest Ubuntu:
	apt-get upgrade 
6. Install make, mysql, python development tools for Zenoss. Note that the mysql dev version number is different for each mysql release. The “15” version below is for mysql 5.0.x. Easy way to find your version is run “/etc/init.d/mysql status” . Go to http://packages.ubuntu.com to check for correct package. Since Zenoss 2.1.2 requires python 2.4, you may need to install python2.4-dev instead of python-dev.
	apt-get install build-essential autoconf swig
	apt-get install libmysqlclient15-dev
	apt-get install python-dev 
7. Ubuntu server installs using DHCP – we should be using a static IP:
	nano /etc/network/interfaces
	iface eth0 inet dhcp          - change this line to the following (assume 192.168.3.10)
	iface eth0 inet static
	        address 192.168.3.10
	        netmask 255.255.255.0
	        network 192.168.3.0
	        broadcast 192.168.3.255
	        gateway 192.168.3.1 
8. Edit /etc/hosts file for your new IP address. Assuming you named the server “zenoss” and running in “mydomain.inc”, change the second 127.0.0.1 to:
	192.168.3.10   zenoss.mydomain.inc   zenoss 
9. Restart the network:
	/etc/init.d/networking restart 
10. Add zenoss user:
	adduser zenoss 
11. Add zenoss install directory:
	mkdir /usr/local/zenoss
	chown zenoss /usr/local/zenoss 
12. Login as zenoss user and set up some variables in login script:
	su zenoss
	cd        (goto home directory)
	nano  .bashrc
	     (add these lines)
	   export ZENHOME=/usr/local/zenoss
	   export PYTHONPATH=$ZENHOME/lib/python
	   export PATH=$ZENHOME/bin:$PATH 
13. Some zenoss daemons require root access, so add zenoss to sudo users. Login as root:
	visudo	(loads sudo editor – nano in this case - add the following 2 lines)
	   zenoss monitor = NOPASSWD: /usr/local/zenoss/bin/*,/bin/kill
	   Defaults env_keep += "PYTHONPATH ZENHOME" 
14. Zenoss requires the mysql root password to be not blank (default), so we need to change the mysql password. Login as root:
	/etc/init.d/mysql stop	(stop mysql)
	nano mysql-init	(create a new file and enter this line:)
	    SET PASSWORD FOR 'root'@'localhost' = PASSWORD('MyNewPassword');
	mysqld_safe --init-file=~/mysql-init &
	/etc/init.d/mysql start   (start mysql)
	rm mysql-init 
15. Get latest zenoss tarball from this download link. I don't recommend using subversion to download since it gets the latest beta release, not the stable release. To use svn need to download svn first from universe. Login as root::
	apt-get install svn-buildpackage   (only if svn needed)
	su zenoss	(login as zenoss)
	cd		(change to /home/zenoss)
                        (do either)
        wget http://easynews.dl.sourceforge.net/sourceforge/zenoss/zenoss-9.99.9.tar.gz
        tar -xzf zenoss*.gz
                        (or this)
	svn co http://dev.zenoss.org/svn/trunk/inst zenossinst	(download latest beta to zenossinst subdir) 
16. Install zenoss from its install directory. For mysql, use the default root user, with the password you used in step 14. For zenoss password, create a new one:
	cd zenoss*
	./install.sh	(cross your fingers)
        zenoss restart 
17. If install fails, cleanup with:
	make clean 
18. If install says successful, browse the zenoss portal
	Go to http:// 192.168.3.10:8080/zport/dmd
	Username is "admin"
	Password is the one entered for Zenoss "admin" user in step 16 
19. To monitor your zenoss server, install SNMP agent. After installing, you need to configure it to allow ‘public’ to read all OIDs (default is to read very few OIDs):
	apt-get install snmpd
	cp /etc/snmp/snmpd.conf  /etc/snmp//snmpd.conf.bak
	snmpconf	(configure snmpd agent to allow public read)
	cp snmpd.conf  /etc/snmp/
	/etc/init.d/snmpd restart 
20. Default ubuntu mail agent (MTA) is exim4, which may need to be setup if you want email alerts to work with a remote mail server (mail.mydomain.inc):
	dpkg-reconfigure exim4-config		(select default options, except for below)
	mail sent by smarthost; received via SMTP or fetchmail
	mail.mydomain.inc 
21. To test mail agent, need to install a frontend (MUA - mail) to exim4:
	apt-get install mailutils
	mail [email protected]
	(press enter for Cc:, type in subject, press enter)
	(type in body of message, then enter)
	.   (type in single period, then enter, to end composing and email is queued)
	mailq (to see if mail is sent or still in queue) 

22. For Windows monitoring, install SNMP from add/remove Windows monitoring components, then install SNMP-Informant – download the free SNMP for Windows. <
> 23. Read the Zenoss Admin guide <
>

24. To add zenoss daemons to run at boot up, login as root. Apached runtime is 90, so we use 95 to have it run after it and mysql. Also need to modify zenoss script for ZENHOME path:
	cp $ZENHOME/bin/zenoss  /etc/init.d 
	nano  /etc/init.d/zenoss
	       (add the following line to ensure all scripts can find ZENHOME)
	    export ZENHOME=/usr/local/zenoss
	update-rc.d zenoss 95 

Troubleshooting

no snmp found for ip

If you get "no snmp found for ip" error on running zendisc or adding a device, edit /etc/default/snmpd and remove 127.0.0.1 from this line: # snmpd options (use syslog, close stdin/out/err). SNMPDOPTS='-Lsd -Lf /dev/null -u snmp -I -smux -p /var/run/snmpd.pid 127.0.0.1' Then restart snmpd.

snmpwalk

If you need snmpwalk command, install the tinysnmp-agent package.

See also

External links

Thanks to the following useful ubuntu / mysql / zenoss sites: