使用zenoss用户登陆后,让我们看看目录下面都是些什么:
 
[zenoss@localhost ~]$ ls -l
total 88
-rwxr-xr-x   1 zenoss zenoss  1399 Oct  3 02:52 appliance_update.sh
drwxrwxrwx   2    777 zenoss  4096 Mar 10 10:36 backup
drwxr-xr-x   2 zenoss zenoss  4096 Mar 14 13:57 bin
-rwxr-xr-x   1 zenoss zenoss 11025 Jul 12  2007 build-functions.sh
-rwxr-xr-x   1 zenoss zenoss   723 May 13  2007 build.sh
drwxrwxr-x   2 zenoss zenoss  4096 Mar 27 22:34 etc
drwxr-xr-x   2 zenoss zenoss  4096 Dec 20 19:52 export
drwxr-xr-x   2 zenoss root    4096 Mar  7 01:12 Extensions
drwxr-xr-x   3 zenoss zenoss  4096 Dec 20 19:52 extras
drwxr-xr-x   2 zenoss root    4096 Mar  7 01:12 import
-rwxr-xr-x   1 zenoss zenoss  5828 Oct  3 02:52 install-functions.sh
drwxr-xr-x   3 zenoss zenoss  4096 Dec 20 19:52 lib
drwxr-xr-x   2 zenoss zenoss  4096 Dec 20 19:52 libexec
drwxrwxr-x   2 zenoss zenoss  4096 Mar 30 04:02 log
drwxr-x---   3 zenoss zenoss  4096 Mar  7 01:15 perf
drwxr-xr-x  30 zenoss zenoss  4096 Mar 10 12:49 Products
-rw-r--r--   1 root   root     481 Mar  7 01:12 README.txt
-rwxr-xr-x   1 zenoss zenoss  1533 Sep 19  2007 shared-functions.sh
drwxrwxr-x   2 zenoss zenoss  4096 Mar 27 22:34 var
 
先看看README.txt
 
[zenoss@localhost ~]$ vi README.txt  

This directory contains an "instance home" for the Zope application
server.  It contains the following directories:

  bin/         Scripts used to control the Zope instance <==Zope脚本
  etc/         Configuration files <==配置文件
  Extensions/  Python sources for External Methods <==Python源码 
  log/         Log files <== 日志文件
  lib/python/  Installed Python packages specific to the instance <== Python库
  Products/    Installed Zope Products specific to the instance <== Zope设备
  var/         Run-time data files, including the object database <==缓存文件
 
对我来说比较重要的目录是/etc,/log,/perf和/var
 
先来看看/etc目录下面,这个目录下面我用到最多的是sysconfig子目录:
 
[zenoss@localhost /]$ cd /etc/sysconfig/
[zenoss@localhost sysconfig]$ ls -l
total 96
-rw-r--r--  1 root root   13 Mar 21 13:06 appliance-group
-rw-r--r--  1 root root   12 Dec 20 19:49 appliance-name
-rw-r--r--  1 root root  194 Dec 20 19:56 authconfig
-rw-r--r--  1 root root   41 Mar 27 22:29 clock
-rw-r--r--  1 root root   41 Mar 27 22:29 clock.back
-rw-r--r--  1 root root  512 May 26  2006 crond
-rw-r--r--  1 root root   88 Aug 13  2004 gpm
-rw-r--r--  1 root root 2909 Mar 27 22:33 hwconf
-rw-r--r--  1 root root   47 Mar 14  2007 i18n
-rw-r--r--  1 root root  991 May 20  2003 init
-rw-r--r--  1 root root 1389 Jul 20  2004 ip6tables-config
-rw-r--r--  1 root root 1378 Jul 20  2004 iptables-config
-rw-r--r--  1 root root   32 Feb  9  2006 keyboard
-rw-r--r--  1 root root  168 Jul  9  2004 kudzu
-rw-r--r--  1 root root   47 Aug 11  2005 lighttpd
-rw-r--r--  1 root root   57 Feb  9  2006 mouse
-rw-r--r--  1 root root   70 Mar 24 10:41 network
drwxr-xr-x  2 root root 4096 Mar 24 08:59 network-scripts
-rw-r--r--  1 root root  122 Jan 19 02:23 ntpd
-rw-r--r--  1 root root  111 Jul  8  2004 samba
-rw-r--r--  1 root root   71 Nov 13 09:05 snmpd
-rw-r--r--  1 root root   77 Aug 16  2007 snmptrapd
-rw-r--r--  1 root root  454 Jul  8  2004 syslog
-rwxr-xr-x  1 root root  115 Feb 16  2005 system-config-securitylevel
 
这里的network文件就是配置主机名的地方,而network-scripts目录下面则包含了Zope的网络信息,主要是看ifcfg-eth0文件,这是网卡的第一个接口,如果需要配置固定IP,除了Zenoss自带的管理界面,就是到这里来配置了(记得先给zenoss用户权限)
 
[zenoss@localhost network-scripts]$ vi ifcfg-eth0  

# Device file installed by rBuilder
DEVICE=eth0
BOOTPROTO=dhcp
#BOARDCAST=xxx.xxx.xxx.xxx
#IPADDR=xxx.xxx.xxx.xxx
#NETMASK=xxx.xxx.xxx.xxx
#NETWORK=xxx.xxx.xxx.xxx
#HWADDR=XX:XX:XX:XX:XX:XX
#GATEWAY=xxx.xxx.xxx.xxx
NETWORKING=yes
ONBOOT=yes
TYPE=Ethernet
 
可以看到BOOTPROTO中目前配置的是dhcp,如果这里换成static,并将后面的条目激活,即可配置成静态IP地址。最后重启network服务
 
[root@localhost ~]# service network restart
Shutting down interface eth0:  [  OK  ]
Shutting down loopback interface:  [  OK  ]
Bringing up loopback interface:  [  OK  ]
Bringing up interface eth0:  
Determining IP information for eth0... done.
[  OK  ]
 
看完了/etc目录来看/log目录,这里存放着Zenoss-Core所有的日志文件,也是做Troubleshooting最常来的地方:
 
[root@localhost zenoss]# cd log
[root@localhost log]# ls -l
total 19528
-rwxrwxr-x  1 zenoss zenoss       0 Mar 30 04:02 event.log
-rwxrwxr-x  1 zenoss zenoss   30115 Mar 30 04:02 event.log.1
-rwxrwxr-x  1 zenoss zenoss    7252 Mar 30 04:02 event.log.2.bz2
-rwxrwxr-x  1 zenoss zenoss      57 Mar  7 01:12 README.txt
-rwxrwxr-x  1 zenoss zenoss 1237265 Mar 31 18:42 Z2.log
-rwxrwxr-x  1 zenoss zenoss 9072405 Mar 30 04:02 Z2.log.1
-rwxrwxr-x  1 zenoss zenoss  237487 Mar 30 04:02 Z2.log.2.bz2
-rwxrwxr-x  1 zenoss zenoss  353163 Mar 31 18:42 zenactions.log
-rwxrwxr-x  1 zenoss zenoss 1506793 Mar 30 04:02 zenactions.log.1
-rwxrwxr-x  1 zenoss zenoss   69050 Mar 30 04:02 zenactions.log.2.bz2
-rwxrwxr-x  1 zenoss zenoss     546 Mar 31 16:34 zencommand.log
-rwxrwxr-x  1 zenoss zenoss   58491 Mar 30 04:02 zencommand.log.1
-rwxrwxr-x  1 zenoss zenoss   20275 Mar 30 04:02 zencommand.log.2.bz2
-rwxrwxr-x  1 zenoss zenoss  292194 Mar 31 18:41 zeneventlog.log
-rwxrwxr-x  1 zenoss zenoss 1271079 Mar 30 04:02 zeneventlog.log.1
-rwxrwxr-x  1 zenoss zenoss   34673 Mar 30 04:02 zeneventlog.log.2.bz2
-rwxrwxr-x  1 zenoss zenoss       0 Mar 30 04:02 zenhub.log
-rwxrwxr-x  1 zenoss zenoss   26578 Mar 30 04:02 zenhub.log.1
-rwxrwxr-x  1 zenoss zenoss    2416 Mar 30 04:02 zenhub.log.2.bz2
-rwxrwxr-x  1 zenoss zenoss   30457 Mar 31 10:44 zenmodeler.log
-rwxrwxr-x  1 zenoss zenoss  266934 Mar 30 04:02 zenmodeler.log.1
-rwxrwxr-x  1 zenoss zenoss    8106 Mar 30 04:02 zenmodeler.log.2.bz2
-rwxrwxr-x  1 zenoss zenoss  343605 Mar 31 18:40 zenperfsnmp.log
-rwxrwxr-x  1 zenoss zenoss 1522357 Mar 30 04:02 zenperfsnmp.log.1
-rwxrwxr-x  1 zenoss zenoss   61793 Mar 30 04:02 zenperfsnmp.log.2.bz2
-rwxrwxr-x  1 zenoss zenoss  352721 Mar 31 18:42 zenping.log
-rwxrwxr-x  1 zenoss zenoss 1419863 Mar 30 04:02 zenping.log.1
-rwxrwxr-x  1 zenoss zenoss   41393 Mar 30 04:02 zenping.log.2.bz2
-rwxrwxr-x  1 zenoss zenoss   71889 Mar 31 18:41 zenprocess.log
-rwxrwxr-x  1 zenoss zenoss  313323 Mar 30 04:02 zenprocess.log.1
-rwxrwxr-x  1 zenoss zenoss    5763 Mar 30 04:02 zenprocess.log.2.bz2
-rwxrwxr-x  1 zenoss zenoss  204608 Mar 31 18:42 zenstatus.log
-rwxrwxr-x  1 zenoss zenoss  883925 Mar 30 04:02 zenstatus.log.1
-rwxrwxr-x  1 zenoss zenoss   15393 Mar 30 04:02 zenstatus.log.2.bz2
-rwxrwxr-x  1 zenoss zenoss       0 Mar 30 04:02 zensyslog.log
-rwxrwxr-x  1 zenoss zenoss    6682 Mar 30 04:02 zensyslog.log.1
-rwxrwxr-x  1 zenoss zenoss    1462 Mar 30 04:02 zensyslog.log.2.bz2
-rwxrwxr-x  1 zenoss zenoss       0 Mar 30 04:02 zentrap.log
-rwxrwxr-x  1 zenoss zenoss    5848 Mar 30 04:02 zentrap.log.1
-rwxrwxr-x  1 zenoss zenoss    1541 Mar 30 04:02 zentrap.log.2.bz2
-rwxrwxr-x  1 zenoss zenoss       0 Mar 30 04:02 zenwin.log
-rwxrwxr-x  1 zenoss zenoss    2625 Mar 30 04:02 zenwin.log.1
-rwxrwxr-x  1 zenoss zenoss    1039 Mar 30 04:02 zenwin.log.2.bz2
-rwxrwxr-x  1 zenoss zenoss       0 Mar 30 04:02 zenwinmodeler.log
-rwxrwxr-x  1 zenoss zenoss    4592 Mar 30 04:02 zenwinmodeler.log.1
-rwxrwxr-x  1 zenoss zenoss    1307 Mar 30 04:02 zenwinmodeler.log.2.bz2
-rwxrwxr-x  1 zenoss zenoss       0 Mar 30 04:02 zeo.log
-rwxrwxr-x  1 zenoss zenoss   26435 Mar 30 04:02 zeo.log.1
-rwxrwxr-x  1 zenoss zenoss    5026 Mar 30 04:02 zeo.log.2.bz2
 
最常看的日志是zenactions.log,这个日志里记录了Zenoss-Core处理信息
 
[zenoss@localhost log]# vi +100000 zenactions.log
 
2008-03-31 18:41:30 INFO zen.ZenActions: sent email:[zenoss] CLEAR: DeviceName xxx ip xxx.xxx.xxx.xxx is up to:['[email]xxx@xxx.com[/email]']
2008-03-31 18:41:30 INFO zen.ZenActions: processed 2 rules in 0.49 secs
2008-03-31 18:42:30 INFO zen.ZenActions: Processed 0 commands in 0.001219
2008-03-31 18:42:30 INFO zen.ZenActions: processed 2 rules in 0.01 secs
2008-03-31 18:43:30 INFO zen.ZenActions: Processed 0 commands in 0.000000
2008-03-31 18:43:30 INFO zen.ZenActions: processed 2 rules in 0.01 secs
2008-03-31 18:44:30 INFO zen.ZenActions: Processed 0 commands in 0.000053
2008-03-31 18:44:30 INFO zen.ZenActions: processed 2 rules in 0.01 secs
2008-03-31 18:45:30 INFO zen.ZenActions: Processed 0 commands in 0.000050
2008-03-31 18:45:30 INFO zen.ZenActions: processed 2 rules in 0.02 secs
 
其次要看的是zencommand.log,这里记录了Zenoss-core每个命令的反馈信息:
 
[zenoss@localhost log]# vi +100000 zencommand.log

2008-03-30 04:34:42 INFO zen.zencommand: ---------- - schedule has 0 commands
2008-03-30 10:34:42 INFO zen.zencommand: ---------- - schedule has 0 commands
2008-03-30 16:34:42 INFO zen.zencommand: ---------- - schedule has 0 commands
2008-03-30 22:34:43 INFO zen.zencommand: ---------- - schedule has 0 commands
2008-03-31 04:34:43 INFO zen.zencommand: ---------- - schedule has 0 commands
2008-03-31 10:34:43 INFO zen.zencommand: ---------- - schedule has 0 commands
2008-03-31 16:34:43 INFO zen.zencommand: ---------- - schedule has 0 commands
 
然后是zenperfsnmp,记录了snmp的反馈信息,如果SNMP工作不正常或采集不到数据可以到这里来找原因
 
[root@localhost log]# vi +100000 zenperfsnmp.log

2008-03-31 18:25:13 INFO zen.zenperfsnmp: Count 7 good 6 bad 0 time 0.136089
2008-03-31 18:25:13 INFO zen.zenperfsnmp: sent 196 OID requests
2008-03-31 18:25:13 INFO zen.zenperfsnmp: collected 7 of 7 devices in 0.15
2008-03-31 18:25:13 INFO zen.zenperfsnmp: Count 7 good 7 bad 0 time 0.152120
2008-03-31 18:30:13 INFO zen.zenperfsnmp: Count 7 good 0 bad 0 time 0.000000
2008-03-31 18:30:13 INFO zen.zenperfsnmp: Count 7 good 1 bad 0 time 0.056048
2008-03-31 18:30:13 INFO zen.zenperfsnmp: Count 7 good 2 bad 0 time 0.096148
2008-03-31 18:30:13 INFO zen.zenperfsnmp: Count 7 good 3 bad 0 time 0.112122
2008-03-31 18:30:13 INFO zen.zenperfsnmp: Count 7 good 4 bad 0 time 0.136160
2008-03-31 18:30:13 INFO zen.zenperfsnmp: Count 7 good 5 bad 0 time 0.159661
2008-03-31 18:30:13 INFO zen.zenperfsnmp: Count 7 good 6 bad 0 time 0.175987
 
看过了/log目录,再接下来是/perf目录,这里存放的是Zenoss-Core的ZenPack信息以及设备的信息:
 
[zenoss@localhost ~]$ cd perf/Devices
 
所有设备的信息都被保存在这里,如果需要单独Troubleshooting某一个设备,可以直接到这里来找。
 
最后看的是/var目录,这里的缓存文件很重要,很多时候Zenoss不能正常工作就是因为缓存文件没有及时清理,所有的缓存文件都是以.zec结尾的:
 
[root@localhost var]# ls -l
total 65144
-rwxrwxr-x  1 zenoss zenoss 49404102 Mar 31 18:02 Data.fs
-rw-r--r--  1 zenoss zenoss   500624 Mar 27 22:32 Data.fs.index
-rw-r--r--  1 zenoss zenoss        5 Mar 27 22:34 Data.fs.lock
-rwxrwxr-x  1 zenoss zenoss    86104 Mar 31 18:02 Data.fs.tmp
-rwxrwxr-x  1 zenoss zenoss      299 Mar  7 01:12 README.txt
-rw-r--r--  1 zenoss zenoss        4 Mar 27 22:34 Z2.lock
-rw-r--r--  1 zenoss zenoss        4 Mar 27 22:34 Z2.pid
-rwxrwxr-x  1 zenoss zenoss        4 Mar 27 22:34 zenactions.py.pid
-rwxrwxr-x  1 zenoss zenoss        4 Mar 27 22:34 zencommand.py.pid
-rwxrwxr-x  1 zenoss zenoss        4 Mar 27 22:34 zeneventlog.py.pid
-rw-r--r--  1 zenoss zenoss 10485760 Mar 31 18:02 zenhub-1.zec <==缓存文件 
-rw-r--r--  1 zenoss zenoss        4 Mar 27 22:34 zenhub.py.pid
-rw-r--r--  1 zenoss zenoss        4 Mar 27 22:34 zenmodeler.py.pid
-rwxrwxr-x  1 zenoss zenoss        4 Mar 27 22:34 zenperfsnmp.py.pid
-rw-r--r--  1 zenoss zenoss        4 Mar 27 22:34 zenping.py.pid
-rwxrwxr-x  1 zenoss zenoss        4 Mar 27 22:34 zenprocess.py.pid
-rwxrwxr-x  1 zenoss zenoss        4 Mar 27 22:34 zenstatus.py.pid
-rw-r--r--  1 zenoss zenoss        4 Mar 27 22:34 zensyslog.py.pid
-rw-r--r--  1 zenoss zenoss        4 Mar 27 22:34 zentrap.py.pid
-rwxrwxr-x  1 zenoss zenoss        4 Mar 27 22:34 zenwinmodeler.py.pid
-rwxrwxr-x  1 zenoss zenoss        4 Mar 27 22:34 zenwin.py.pid
-rw-r--r--  1 zenoss zenoss 20971520 Mar 31 18:02 zeo1-1.zec <== 缓存文件
-rw-r--r--  1 zenoss zenoss        5 Mar 27 22:34 ZEO.pid
srwx------  1 zenoss zenoss        0 Mar 27 22:34 zopectlsock
 
如果遇到不能正常打开Zenoss Web界面,请尝试以下方法:
 
[root@localhost var]# zpoectl stop
[root@localhost var]# rm zeo1-1.zec
[root@localhost var]# zpoectl start
 
下一篇会讲如何解决RRD不能正常更新的问题以及如何使用Nagios Plugin