Installing Zenoss on RHEL 5 or CentOS 5
Requirements
Run all commands as root, from the machine where you want to install Zenoss. Zenoss requires that Sun JRE 1.5 or later version be installed on your system. The /opt/zenoss directory cannot be a symbolic link to another location. Ensure the umask is set to 022 (masks write permissions for group and others).
Tasks
Before you install:
Installing following packages. which will be used to install Zenoss.
yum -y install net-snmp net-snmp-utils gmp libgomp libgcj liberation-fonts
Download the Zenoss installation files from sourceforge
wget http://nchc.dl.sourceforge.net/project/zenoss/zenoss-3.2/zenoss-3.2.1/zenoss-stack-3.2.1-linux.bin
Make the installer executable. Use this command:
chmod u+x zenoss-stack-3.2.1-linux-x64.bin
Run the Zenoss installer. Zenoss requires that you perform this installation as the root user.
./zenoss-stack-3.2.1-linux-x64.bin
Select default value, prompted by sofwtare, However we will not be using local Mysql server. Hence give some dummy password when prompted by installer. We will configure seperate MySQL server which will be used by both zenoss installation.
-----------------------------------------------------------------
Welcome to the Zenoss Setup Wizard.
----------------------------------------------------------------
Installation folder
Please, choose a folder to install Zenoss
Select a folder [/usr/local/zenoss]:
----------------------------------------------------------------------------
MySQL Credentials
Please enter your database root user password
Hence give some dummy password when prompted by installer
MySQL Server root password :
Re-enter password :
Warning: You need to provide a non-empty password
Press [Enter] to continue :a
------------------------------------------------------------------
MySQL Credentials
Please enter your database root user password
MySQL Server root password :
Re-enter password :
------------------------------------------------------------------
Setup is now ready to begin installing Zenoss on your computer.
Do you want to continue? [Y/n]:
-----------------------------------------------------------------
Please wait while Setup installs Zenoss on your computer.
Installing
0% ______________ 50% ______________ 100%
#########################################
------------------------------------------------------------------
Setup has finished installing Zenoss on your computer.
Launch Zenoss [Y/n]: Y
Info: To access the Zenoss Application, go to http://localhost:8080 from your
browser.
Press [Enter] to continue :
Installation of Zenoss is over.
A user named zenoss is created automatically in the server, to verify use following command
cat /etc/passwd|grep zenoss
zenoss:x:502:503::/home/zenoss:/bin/bash
To verify zenoss status, switch to zenoss user and give following commands
su - zenoss
zenoss status
Open your browser to this location:
http://localhost:8080 /
Where PortNumber is 8080 (by default) or the alternate port number you selected during installation.
Configuring your devices to interact with Zenoss communicate using SNMP.
Configuration details for your platform may vary. Refer to the SNMP documentation for your specific system.
Install NET-SNMP.
yum install net-snmp-utils
Make sure snmpd is installed and running.
Find the snmpd configuration file. Generally, it is located at /etc/snmp/snmpd.conf. Back up the file by renaming it to snmd.conf-back. Create a new snmpd.conf file in the same location.
Edit the new file to contain this single line:
rocommunity public
Restart the SNMP agent. As root, enter this command:
/etc/init.d/snmpd restart
chkconfig snmpd on
Discovering Devices in Zenoss
You can provide network or IP address range information so that the system can discover your devices. Follow these steps to discover Multiple devices:
From the navigation bar, select Infrastructure.
The Devices page appears.
Select Add Multiple Devices (Add Devices).
The Add Devices panel appears.
Select the Autodiscover devices option.
For each network or IP range in which you want Zenoss to discover devices, enter an address or range.
For example, you might enter a network address in CIDR notation:
192.168.0.1/24
or a range of IP addresses:
192.168.0.1-50
If you want to enter multiple addresses or ranges, click +. For each network, you must enter a netmask or IP range.
For each network or IP range, specify the SSH, or SNMP credentials you want Zenoss to use on the devices it discovers. You can enter only one of each. Zenoss will attempt to use the same credentials on each device it discovers within the networks or IP ranges specified, but will not try to automatically classify the devices.
Click Discover.
The discovery process iterates through every IP address in the networks and IP ranges you specify, adding each device that responds to a ping request. Further, the process adds information to any device that responds to an SNMP or SSH request.
Follow these steps to add a single device:
From the navigation bar, select Infrastructure.
The Devices page appears.
Select Add a Single Device
The Add a Single Device dialog appears.
Enter information or make selections to add the device:
• Name or IP - Enter the network (DNS) name or IP address of the device.
• Device Class - Select a device class to which this device will belong.
• Collector - By default, this is localhost. Select a collector for the device.
• Model - By default, this option is selected. De-select this option if you do not want the device to be modeled when it is added.
Optionally, click More to display additional fields. From the expanded page, you can:
• Enter device-specific details
• Edit SNMP settings
• Set hardware and operating system information
• Add device comments
Classifying Discovered Devices
Once discovery is complete, you must move discovered devices (placed, by default, in the /Discovered class) to an appropriate device class in the hierarchy. Moving devices to their correct hierarchy location makes it possible for monitoring to begin.
Servers are organized by operating system. for example, you might choose to relocate them to /Server/<os type>. Similarly, you might choose to classify discovered Linux devices in / Server/Linux (if you want to monitor and model using SNMP), or /Server/SSH/Linux (if you want to monitor and model using SSH).
To classify discovered devices:
Select one or more discovered devices (highlight one or more rows) in the device list.
Drag the selected devices to the new device class in the tree view.
The Move Devices dialog appears.
Click OK.
The list of devices refreshes, and the devices now appear in the newly selected class.
Updating Device Authentication Details
For each device added to the database and set to its proper device class, the system may require additional or different authentication information before it can gather device information and monitor the device.
To do this:
Click a device name in the devices list.
The Device summary page appears.
Enter your SSH user name and password.
Set these values in the device's zCommandUsername and zCommandPassword configuration properties .
After making changes, It is recommended to remodel the device to ensure the authentication changes are valid.
Enter other information to a Device Record
It is advisable to add additional details about a discovered device.
To add information:
Click a device name in the devices list.
The Device summary page appears. Values that appear in text fields can be edited. Enter or change information in one or more fields, and then click Save to save your changes.
Creating and Using Organizers
Within Zenoss you can create organizers. Organizers let you monitor devices in logical groups, such as:
• Systems
• Groups
• Locations
A device can be a member of many groups or systems, but can be in only one location. Use this procedure to add a system to the list of organizers, and then add devices to that system.
From the menu bar, select Infrastructure.
The device list appears.
Click the Systems organizer in the tree view.
Click to add a system.
The Add System dialog appears.
Enter a name and description for the system, and then click Submit. The system is added. Drag one or more devices from the device list to the system.
Adding and Nesting Locations
Use the following procedure to create a location, and then move and nest that location. The locations you add using this procedure are the same locations that Zenoss uses when creating a Google map of your devices. You can use locations to add Google maps addresses. From the menu bar, select Infrastructure.
The device list appears.
Click the Locations organizer in the tree view.
Click to add a location.
The Add Location dialog appears.
Enter a name, description, and address (or zip code) for the location, and then click Submit.
Displaying Locations on the Dashboard
To display locations on the Dashboard:
Go to Dashboard, click the Add portlet link located near the top right of the page. Select Top Level Organizers from the list of options. The Root Organizers portlet appears on the Dashboard. Click the indicator at the top right of the portlet to open the portlet list of options. From the Root Organizer list of options, select Locations.
Click Save Settings.
The portlet displays the status for the locations you have entered.
Event Management
The event console enables you to view and manage events. It displays the repository of all events that are detected by the system.
To access the event console, select Events from the menu bar.
Sorting and Filtering Events
Zenoss lets you sort and filter events that appear in the event console. You can sort events by any column that appears. To sort events, click a column header. Clicking the header toggles between ascending and descending sort order.
Filter options appear below each column header.
You can filter the events that appear in the list in several ways, depending on the field type. Date fields (such as First Seen and Last Seen) allow you to enter a value or use a date selection tool to limit the list. For other fields, such as Device, Component, and Event Class, enter a match value to limit the list.
To clear filters, select Configure > Clear filters.
Viewing Event Details
You can view details for any event in the system. To view details, double-click an event row.
The Event Detail area appears.
Select and manage events from the event console. To select one or more events, you can:
• Click a row to select a single event
• Ctrl-Click rows to select multiple events
• Click Select to select all, none, new, or suppressed events
After selecting an event, you can:
• Acknowledge the event
• Close the event (move it to history)
• Map the event, associating it with a specific event class
• Return the event to New status (revoke its Acknowledged status)
Managing Zenoss Users
Zenoss user accounts is used to link rules and permission, and alerting rule behaviorer. Along with assigned permissions, user accounts comprise login and contact information for a user.
Use the following procedures to:
• Create a user account
• Edit user account details
Creating User Accounts
To create a Zenoss user account:
Log in as a user with administrative privileges.
From the menu bar, select Advanced.
The Settings page appears.
In the left panel, select Users.
From the Action menu, select Add User.
The Add User dialog appears.
Enter a user name and email address for the user account. Click OK. The newly created user appears in the list.
Editing User Account Details
To edit user account details:
Click the user name in the Users list.
The User details page appears.
Enter or select details for the user account.
Enter your administrative password to confirm changes to the account, and then click Save.
Troubleshooting Device Connectivity Issues
Identifying SNMP Agent Issues
Make sure an SNMP agent is running and accessible from the Zenoss server. To check, run this command on the Zenoss server:
$ snmpwalk -c public(custom communit string) -v1 <device_ip>
If the system returns this string, then the device is responding to your SNMP request:
Timeout: No response from xxx.xxx.xxx.xxx
Resolving Linux SNMP Issues
Depending on your device platform, there are several reasons that the device may not be responding to the request.
To resolve this problem, you can:
• Check permissions on the agent side
• Ensure that there is an SNMP daemon running on the target device. To determine if the daemon is running,
issue this command:
netstat -an | grep -i udp
udp 0.0.0.0:161 0.0.0.0:*
If this value is returned , then the agent is running but Zenoss cannot get the information.
If the SNMP daemon is running, but the configuration does not allow connections, then check /etc/snmp/snmpd.conf file and ensure this line is present , If it is blank add this line to grant read access to Zenoss:
rocommunity public
Check firewalls
There may be a firewall on the target device, or between the Zenoss server and the target device. Ensure udp Port 161 is open on both devices.
ZenPacks
ZenPacks extend and modify the system to add new functionality. This can be as simple as adding new device classes or monitoring templates, or as complex as extending the data model and providing new collection daemons.
ZenPacks are used to enhance:
• Monitoring templates
• Data sources
• Graphs
• Event classes
• Event and user commands
• Reports
• Model extensions
• Product definitions
The following sections provide information and procedures to help you:
• Install ZenPacks
• Create ZenPacks
• Package and distribute ZenPacks
• Remove ZenPacks
Installing ZenPacks
ZenPacks are distributed as .egg files. You can install ZenPacks from the command line on the Zenoss server, or from the user interface.
Installing from the Command Line
Use these commands to install a ZenPack file and then restart the system:
zenpack --install <filename>
zenoss restart
If you have the source code for the ZenPack you can install directly from that rather than from an .egg file. The command is same however, you must specify the directory containing the source code. This copies the source
code to /ZenPacks:
zenpack --install <directoryname>
zenoss restart
Installing from the User Interface
To upload and install a ZenPack .egg file from the user interface:
From the navigation bar, select Advanced > Settings.
In the left panel, select ZenPacks.
From (Action menu), select Install ZenPack.
The Install ZenPack dialog appears.
Browse to and select the .egg file you want to install, and then click OK.
The file is uploaded to the Zenoss server and installed. After installing the ZenPack, you should restart the system.
Installing All Core ZenPacks from RPM
The core ZenPacks, along with third party ZenPacks, are available for download individually from:
http://community.zenoss.org/community/zenpacks
At that location is a link to download an RPM that includes the most popular core ZenPacks. To install via the core ZenPacks RPM follow these steps:
Download the appropriate file from the ZenPacks download area specific to your version.
Make sure ZEO is running (as the zenoss user):
zeoctl status
Install the rpm (as root user):
rpm -ihv <rpm file>
Restart Zope and ZenHub:
zopectl restart
zenhub restart
Viewing Loaded ZenPacks
To see which ZenPacks are loaded on your system:
1. From the navigation bar, select Advanced.
The Settings page appears.
2. Select ZenPacks in the left panel.
The list of loaded ZenPacks appears.
From the action menu on this page, you can create, install, and delete ZenPacks.
View ZenPacks from the command line:
zenpack –lis t
Managing Users
Each user has a unique user ID, which allows to assign group permissions and alerting rules that are unique to each user. To create and manage user accounts, you must be logged in to the system admin account, or as a user with extended privileges.
Creating User Accounts
To create a user account:
From the navigation bar, select Advanced.
The Settings page appears.
In the left panel, select Users.
The users and groups administration page appears.
From (Add Menu), select Add New User.
The Add User dialog appears.
In the Username field, enter a unique name for the account.
In the Email field, enter the user account email address. Any alerts that you set up for this user will be send to this address.
Click OK.
The user appears in the User List.
After creating the account, edit the account to provide a password and additional user details.
Editing User Accounts
In the Users list, click the name of the user you want to edit.
The edit user page appears
Make changes to folowing settings:
• New Password / Confirm New Password - Enter and confirm a new password for the user.
• Reset Password - Facilitates user self-service by allowing a user to reset his password. Click to reset and
email the new password to the email address associated with the user's account.
• Roles - Assign one or more roles (user privileges) to the user. To edit or assign roles, you must be a system
Admin or be assigned the Manager role.
• Groups - Specify one or more groups to which this user belongs.
• Email - Enter the user's email address. To verify that the address is valid, click the test link.
• Pager - Enter the user's Mobile number.
• Default Page Size - Controls how many entries (by default) appear in tables. Enter a value for the default
page size. The default value is 40.
• Default Admin Role - Select the default role that this user will have for administered objects associated
with him.
• Network Map Start Object - Specify the default view for this user in the network map.
Enter your password, and then click Save to confirm and save your changes.
Associating Objects with Specific Users
You can associate any object in the system with a particular user, for monitoring or reporting purposes. Once associated with a user, you can then assign the user a specific role that applies to his privileges with respect to that object.
To create an object association:
From Advanced > Settings, select Administered Objects in the left panel.
The list of administered objects appears.
Select an object type from the Administered Objects Action menu. You can add:
• Device
• Device class
• System
• Group
• Location
The Add Administered Device dialog appears.
Specify the component you want to add as an administered object, and then click OK.
The object appears in the Administered Devices list for the user.
Creating Groups
Zenoss allows to create user groups. By grouping users, you can aggregate rules and apply them across multiple user accounts.
Viewing User Groups
To view user groups, select Advanced > Settings, and then select Users from the left panel.
The groups area shows each user group and the users assigned to that group.
Creating User Groups
You can create user groups to aggregate rules and apply them across multiple user accounts.
To create a user group:
Select Advanced > Settings.
In the left panel, select Users
The Users page appears.
From the Groups area Action menu, select Add New Group.
The Add Group dialog appears.
In the Group field, enter a name for this user group, and then click OK.
The group name appears in the Groups list.
Click the name of the group you created.
The Users in Group page appears.
From the Action menu, select Add User.
The Add User to Group dialog appears
From the User list of selections, select one or more users you want to add to the group, and then click OK.
The user or users you select appear in the list of users for this group.
General Settings
Mail Settings
You must be logged in to a user account with management privileges.
1. From the navigation bar, select Advanced.
The Settings page appears.
Change the following SMTP settings as needed:
Field | Description |
SMTP Host | Enter Mail server IP/Hostname |
SMTP Port | Default port 25 |
SMTP Username | Enter username |
SMTP Password | Enter password |
From Address for Email | Enter a value if you want email to come from a specific email address. |
Use TLS? | Select this option if you use transport layer security for your email alerts. |
Configure MYSQL DB Server
The zenevents.sql and zenprocs.sql files are located in /Products/ZenEvents/db on zenoss server. Copy these file to MySQL DB Server. Run these scripts to create objects which will be used by zenoss server.
#cd <directory name where these file are stored>
mysql -uroot -ppassword
CREATE DATABASE events;
\. zenevents.sql
\. zenprocs.sql
GRANT ALL PRIVILEGES ON events.* to zenoss@'%' identified by 'password';
FLUSH PRIVILEGES;
Configure MySQL DB Server Connection
To edit DB settings, select Events > Event Manager from the navigation bar. The event manager edit page appears. Edit event database connection settings in both zenoss server and point to same DB Server:
• User Name = zenoss (enter user created for zenoss)
• Password = password (enter password of zenoss user)
• Database = events (zenoss DB name)
• Hostname = <mysql server IP > (server IP/Hostname)
• Port = 3306 (MySQL Port)
Click Save
Restart System.
Zenoss Replication/Clustering.
Zenoss is configured to run in active/passive state. Nginx is used to serve as proxy/load balance server. Custom script is used to check zenoss server status and replicate data.
/usr/local/bin/check_remote is used to check zenoss status and if Zenoss is not running start Zenoss server. This script in turns calls /usr/local/bin/check_sp to check Split brain condition of Zenoss Servers, and ensure only 1 Zenoss server is running.
Replication
/usr/local/bin/update_zenoss script is used to update zenoss status on passive server. The script is intelligent to pull changes from other Zenoss server only if Zenoss on localhost is not running, hence avoids corruption of configuration files, data and graphs.
Nginx proxy configuration
create following file in both nginx server.
cd /etc/nginx/conf.d/
vim zenoss.conf
upstream monitoring {
server zenoss1:8080;
server zenoss2:8080;
}
server {
listen 80;
server_name zenoss.example.com;
access_log /var/log/nginx/zenoss.access.log main;
proxy_set_header Host ;
proxy_set_header X-Real-IP ;
proxy_set_header X-Forwarded-For ;
location / {
proxy_pass ;
proxy_redirect default;
proxy_read_timeout 120;
}
}
Restart nginx server
service nginx restart
Scripts used for Zenoss Replication/Clustering are as follows:
check_remote
#!/bin/bash
rsysname=zenoss1
rss=`ssh zenhub status`
date_time=`date`
/usr/local/zenoss/zenoss/bin/zenhub status
if [ $? -ne 0 ]; then
if `echo |grep pid >/dev/null`; then
echo ": Zenoss is already running on . Remote" `echo |awk '{print $3}'`
else
echo ": Zenoss is not available"
echo ": Starting server"
/usr/local/zenoss/zenoss/bin/zenoss start
echo ": Zenoss started"
fi
fi
echo " checking split brain condtion"
/usr/local/bin/check_sp >> /var/log/check_remote.log
check_sp
#!/bin/bash
rsysname=zenoss1
lpid=`zenhub status|cut -d "=" -f2`
rpid=`ssh zenhub status|cut -d "=" -f2`
lpid_uptime=`ps -eo pid,etime|grep |grep -v grep |awk '{print $2}'`
rpid_uptime=`ssh ps -eo pid,etime|grep |grep -v grep |awk '{print $2}'`
lpid_uptime=`echo |awk -F: '{seconds=($1*60)*60; seconds=seconds+($2*60); seconds=seconds+$3; print seconds}'`
rpid_uptime=`echo |awk -F: '{seconds=($1*60)*60; seconds=seconds+($2*60); seconds=seconds+$3; print seconds}'`
#################checking uptime of zenoss###################
if [ -gt ];then
echo Zenoss running on localhost started earliest. shutting down zenoss from
ssh zenoss stop
echo stopped.
else
echo Zenoss running on locahost started after zenoss running on . Shutting down localhost zenoss
zenoss stop
echo locahost zenoss stoped.
fi
update_zenoss
#!/bin/bash
rsysname=zenoss1
date_time=`date`
/usr/local/zenoss/zenoss/bin/zenhub status
if [ $? -ne 0 ]; then
echo "------------------starting rsync----------------------------------"
echo "rsync pulling files from at "
sudo rsync -av -e "ssh" --rsync-path="sudo rsync" zenoss@:/usr/local/zenoss /usr/local
echo " -----------------rsync completed---------------------------------"
else
echo ": Zenoss is running on localhost. rsync not required"
fi