Difference between revisions of "ZenPack:Linux Monitor"

From Zenoss Wiki
Jump to: navigation, search
Line 12: Line 12:
 
|Flavor=core
 
|Flavor=core
 
}}
 
}}
The <span class="zenpack">ZenPacks.zenoss.EnterpriseLinux</span> ZenPack extends the capabilities of <span class="zenpack">ZenPacks.zenoss.LinuxMonitor</span> and enables <span class="ph">Zenoss platform</span> to use Secure Shell (SSH) to monitor Linux hosts.
+
The <span class="zenpack">ZenPacks.zenoss.LinuxMonitor</span> ZenPack demonstrates how to develop new plugins that collect performance data using Secure Shell.
  
  
<span class="ph">Zenoss platform</span> models and monitors devices placed in the <span class="ph filepath">/Server/SSH/Linux</span> device class by running commands and parsing the output. Parsing of command output is performed on the <span class="ph">Zenoss platform</span> server or on a distributed collector. The account used to monitor the device does not require root access or special privileges for the default modeler plugins.
+
This ZenPack demonstrates the Secure Shell (SSH) features, and enables modeling and monitoring several types of device components for devices placed in the <span class="ph filepath">/Server/SSH/Linux</span> device class by running commands and parsing the output. Parsing of command output is performed on the <span class="ph">Zenoss platform</span> server or on a distributed collector. The account used to monitor the device does not require root access or special privileges.
  
  
Line 29: Line 29:
 
|-
 
|-
 
|Required ZenPacks
 
|Required ZenPacks
|ZenPacks.zenoss.LinuxMonitor,
+
|ZenPacks.zenoss.LinuxMonitor
 
+
ZenPacks.zenoss.EnterpriseLinux
+
 
|}
 
|}
 
 
== Add a Linux Server ==
 
 
 
The following procedure assumes that the credentials have been set.
 
 
 
<ol>
 
<li>From Infrastructure > Devices, Select Add a Single Device from the Add Device menu.
 
</li>
 
<li>Enter the following information:
 
 
 
{| class="wikitable"
 
|+ <span class="tablecap"><span class="tablecap">Adding Linux Device Information</span></span>
 
!width="50%"|Name
 
!width="50%"|Description
 
|-
 
|Device Name
 
 
|Linux host to model
 
 
|-
 
|Device Class Path
 
 
|<span class="ph filepath">/Server/SSH/Linux</span>
 
 
|-
 
|Discovery Protocol
 
 
|Set this to <samp class="ph codeph literal">auto</samp> unless adding a device with username/password different than found in the device class. If you set this to <samp class="ph codeph literal">none</samp>, then you will need to add the credentials, and then manually model the device.
 
 
|}
 
 
 
</li>
 
<li>Click '''Add'''.
 
</li></ol>
 
  
  
Line 85: Line 44:
  
 
<ol>
 
<ol>
<li>Navigate to the device or device class in the <span class="ph">Zenoss platform</span> interface.
+
<li>Select Infrastructure from the navigation bar.
 
+
<ul>
+
<li>If applying changes to a device class:
+
 
+
<ol>
+
<li>Select the class in the devices hierarchy.
+
 
</li>
 
</li>
<li>Click '''Details'''.
+
<li>Click the device name in the device list.
</li>
+
<li>Select Configuration Properties.
+
</li></ol>
+
</li>
+
<li>If applying changes to a device:
+
  
<ol>
+
The device overview page appears.
<li>Click the device in the device list.
+
 
</li>
 
</li>
<li>Select Configuration Properties.
+
<li>Select Configuration Properties from the left panel.
</li></ol>
+
</li></ul>
+
 
</li>
 
</li>
<li>Verify the credentials for the service account to access the service.
+
<li>Verify the credentials for the service account.
  
  
Line 122: Line 67:
 
|zCommandPassword
 
|zCommandPassword
  
|Password for the above user.
+
|Password for the Linux user.
  
 
|}
 
|}
  
  
</li>
 
<li>Click <span class="ph uicontrol guibutton">Save</span> to save your changes.
 
 
</li></ol>
 
</li></ol>
  
  
== Resolving CHANNEL_OPEN_FAILURE Issues ==
+
== Add a Linux Server ==
  
  
The <span class="keyword cmdname">zencommand</span> daemon's log file (<span class="ph filepath">$ZENHOME/<var class="keyword varname replaceable">collector</var>/zencommand.log</span>) may show messages stating:
+
The following procedure assumes that credentials have been set.
  
<pre class="pre codeblock screen">ERROR zen.SshClient CHANNEL_OPEN_FAILURE: Authentication failure
 
WARNING:zen.SshClient:Open of command failed (error code 1): open failed</pre>
 
If the <span class="keyword cmdname">sshd</span> daemon's log file on the remote device is examined, it may report that the <samp class="ph codeph literal">MAX_SESSIONS</samp> number of connections has been exceeded and that it is denying the connection request. At least in the OpenSSH daemons, this <samp class="ph codeph literal">MAX_SESSIONS</samp> number is a compile-time option and cannot be reset in a configuration file.
 
 
In order to work around this limitation of the <span class="keyword cmdname">sshd</span> daemon, use the configuration property <var class="keyword varname">zSshConcurrentSessions</var> to control the number of connections created by <span class="keyword cmdname">zencommand</span> to the remote device.
 
  
 
<ol>
 
<ol>
<li>Navigate to the device or device class in the <span class="ph">Zenoss platform</span> interface.
+
<li>Select Infrastructure from the navigation bar.
 
+
<ul>
+
<li>If applying changes to a device class:
+
 
+
<ol>
+
<li>Select the class in the devices hierarchy.
+
 
</li>
 
</li>
<li>Click '''Details'''.
+
<li>Select Add a Single Device from the Add Device list of options.
</li>
+
<li>Select Configuration Properties.
+
</li></ol>
+
</li>
+
<li>If applying changes to a device:
+
  
<ol>
+
The Add a Single Device dialog appears.
<li>Click the device in the device list.
+
</li>
+
<li>Select Configuration Properties.
+
</li></ol>
+
</li></ul>
+
 
</li>
 
</li>
<li>Apply an appropriate value for the maximum number of sessions.
+
<li>Enter the following information in the dialog:
  
  
 
{| class="wikitable"
 
{| class="wikitable"
|+ <span class="tablecap"><span class="tablecap">Concurrent SSH Configuration Properties</span></span>
+
|+ <span class="tablecap"><span class="tablecap">Adding Linux Device Details</span></span>
 
!width="50%"|Name
 
!width="50%"|Name
 
!width="50%"|Description
 
!width="50%"|Description
 
|-
 
|-
|zSshConcurrentSessions
+
|Name or IP
  
|Maximum number of sessions supported by the remote device's <samp class="ph codeph literal">MAX_SESSIONS</samp> parameter. A common value for Linux is 10.
+
|Linux host to model.
  
|}
+
|-
 +
|Device Class
  
 +
|<span class="ph filepath">/Server/SSH/Linux</span>
  
</li>
 
<li>Click <span class="ph uicontrol guibutton">Save</span> to save your changes.
 
</li></ol>
 
 
 
== Resolving Command timed out Issues ==
 
 
 
The <span class="keyword cmdname">zencommand</span> daemon's log file (<span class="ph filepath">$ZENHOME/<var class="keyword varname replaceable">collector</var>/zencommand.log</span>) may show messages stating:
 
 
<pre class="pre codeblock screen">WARNING:zen.zencommand:Command timed out on device device_name: command</pre>
 
If this occurs, it usually indicates that the remote device has taken too long to return results from the commands. To increase the amount of time to return results, change the configuration property <var class="keyword varname">zCommandCommandTimeout</var> to a larger value.
 
 
<ol>
 
<li>Navigate to the device or device class in the <span class="ph">Zenoss platform</span> interface.
 
 
<ul>
 
<li>If applying changes to a device class:
 
 
<ol>
 
<li>Select the class in the devices hierarchy.
 
</li>
 
<li>Click '''Details'''.
 
</li>
 
<li>Select Configuration Properties.
 
</li></ol>
 
</li>
 
<li>If applying changes to a device:
 
 
<ol>
 
<li>Click the device in the device list.
 
</li>
 
<li>Select Configuration Properties.
 
</li></ol>
 
</li></ul>
 
</li>
 
<li>Apply an appropriate value for the command timeout.
 
 
 
{| class="wikitable"
 
|+ <span class="tablecap"><span class="tablecap">SSH Timeout Configuration Properties</span></span>
 
!width="50%"|Name
 
!width="50%"|Description
 
 
|-
 
|-
|zCommandCommandTimeout
+
|Model Device
  
|Time in seconds to wait for commands to complete on the remote device.
+
|Select this option unless adding a device with a user name and password different than found in the device class. If you do not select this option, then you must add the credentials (see ) and then manually model the device.
  
 
|}
 
|}
Line 233: Line 114:
  
 
</li>
 
</li>
<li>Click <span class="ph uicontrol guibutton">Save</span> to save your changes.
+
<li>Click '''Add'''.
 
</li></ol>
 
</li></ol>
 
 
== DMIDECODE Modeler Plugin ==
 
 
 
This plugin allows you to collect and model detailed hardware and kernel information on your Linux devices.
 
 
Since the <span class="ph filepath">dmidecode</span> command requires root privileges, it needs to be run with something like <span class="ph filepath">sudo</span>. Sample entries required on the sudoers file on each remote device are:
 
 
<pre class="pre codeblock programlisting">Cmnd_Alias DMIDECODE = /usr/sbin/dmidecode
 
## Allows members of the zenoss group to gather modeling information
 
Defaults:zenoss !requiretty
 
%zenoss ALL = (ALL) NOPASSWD: DMIDECODE </pre>
 
To use this plugin, add it to the list of collector plugins for the device or device class, and then remodel. For more information about working with <span class="ph">Zenoss platform</span> plugins, refer to <cite class="cite">Zenoss Service Dynamics Resource Management Administration</cite>.
 
  
  
Line 259: Line 126:
 
|-
 
|-
 
|Modeler
 
|Modeler
|zenmodeler
+
|<span class="keyword cmdname">zenmodeler</span>
 
|-
 
|-
 
|Performance Collector
 
|Performance Collector
|zencommand
+
|<span class="keyword cmdname">zencommand</span>
 
|}
 
|}
 
{{ZenPackFooter}}
 
{{ZenPackFooter}}

Revision as of 22:28, 24 February 2014

Note: This is a Core ZenPack which can be found in the Core Zenoss RPM, and is fully documented in the Zenoss Extended Monitoring Guide. If you did not install this pack when you installed Zenoss Core, it can be found in $ZENHOME/packs.

Organization
Zenoss, Inc.
ZenPack name
ZenPacks.zenoss.LinuxMonitor
Link to more docs
View Documentation




Linux Monitor ZenPack

This ZenPack monitors Linux systems via ssh.

Warning

The ZenPack Catalog has moved to its new home at https://www.zenoss.com/product/zenpacks as of January 17, 2017. The following information may be out of date, and this page will eventually be removed.

Support

This ZenPack is part of Zenoss Core. Open Source users receive community support for this ZenPack via our online forums. Enterprise support for this ZenPack is provided to Zenoss customers with an active subscription.

Background

The ZenPacks.zenoss.LinuxMonitor ZenPack demonstrates how to develop new plugins that collect performance data using Secure Shell.


This ZenPack demonstrates the Secure Shell (SSH) features, and enables modeling and monitoring several types of device components for devices placed in the /Server/SSH/Linux device class by running commands and parsing the output. Parsing of command output is performed on the Zenoss platform server or on a distributed collector. The account used to monitor the device does not require root access or special privileges.


Prerequisites

Prerequisite Restriction
Product Zenoss platform 4.x, Zenoss 2.4 or higher
Required ZenPacks ZenPacks.zenoss.LinuxMonitor


Set Linux Server Monitoring Credentials

All Linux servers must have a device entry in an organizer below the /Devices/Server/SSH/Linux device class.


Tip: The SSH monitoring feature will attempt to use key-based authentication before using a configuration properties password value.


  1. Select Infrastructure from the navigation bar.
  2. Click the device name in the device list. The device overview page appears.
  3. Select Configuration Properties from the left panel.
  4. Verify the credentials for the service account.
    Linux Configuration Properties
    Name Description
    zCommandUsername Linux user with privileges to gather performance information.
    zCommandPassword Password for the Linux user.



Add a Linux Server

The following procedure assumes that credentials have been set.


  1. Select Infrastructure from the navigation bar.
  2. Select Add a Single Device from the Add Device list of options. The Add a Single Device dialog appears.
  3. Enter the following information in the dialog:
    Adding Linux Device Details
    Name Description
    Name or IP Linux host to model.
    Device Class /Server/SSH/Linux
    Model Device Select this option unless adding a device with a user name and password different than found in the device class. If you do not select this option, then you must add the credentials (see ) and then manually model the device.


  4. Click Add.


Daemons

Type Name
Modeler zenmodeler
Performance Collector zencommand

Installation

Normal Installation (packaged egg)

  1. Download the appropriate egg file for the version of Zenoss you are running.
  2. Ensure you are logged in as the zenoss user:
    $ sudo su - zenoss
  3. Install the ZenPack:
    $ zenpack --install ZenPacks.zenoss.LinuxMonitor-*.egg
  4. Restart these services:
    $ zenoss restart

Developer Mode Installation

In order to do a development mode installation you will want to clone the existing git repository, and then use the --link flag with the zenpack command:

  1. Ensure you are logged in as the zenoss user:
    $ sudo su - zenoss
  2. Start by cloning the upstream repository:
    $ git clone git://github.com/path/to/repo
  3. Next, perform the installation:
    $ zenpack --link --install ZenPacks.zenoss.LinuxMonitor
  4. Finally, restart these serivices:
    $ zenoss restart

Discuss

Purplemarker.png New: Don't forget to add yourself to the Zenoss User Map!

blog comments powered by Disqus