Archived community.zenoss.org | full text search
Skip navigation
Currently Being Moderated

HTTP Components

VERSION 9  Click to view document history
Created on: Dec 5, 2011 11:00 AM by j053ph4 - Last Modified:  Oct 3, 2012 12:50 PM by j053ph4
Visibility: Open to anyone

Developed by: Joseph Anderson


Description:

 

This zenpack allows monitored URLs to be managed as if they were device components, using the standard GUI component management methods. It utilizes the "check-http" Nagios plugin that ships with Zenoss, but the command plugin arguments are the component attributes assigned at component creation. 

 

URLs can be added via the "add components" menu on the Device Status page, and can be removed or otherwise modified using the menus in the Components Pane of the Device Status page.

 

Special thanks to Jane Curry and all others who dug into the details of the new GUI interface.  The "MenuExamples" zenpack was instrumental in the creation of this Zenpack, which wouldn't have been possible without it.

 

Screenshots:

http-components-1.png

 

http-components-2.png

http-components-3.png

 

 

Components:

 

The ZenPack has the following Objects

  • HttpComponent Template provides a component-level modified version of the standard "HttpMonitor" template that ships with Zenoss.

 

The ZenPack also provides:

  • HTTPComponent Device Component
  • Javascript code to support GUI management.

 

Installation:

Describe the install process if anything is needed before or after standard ZenPack installation.

 


Requirements:

  • Zenoss Versions Supported: 3.0
  • External Dependencies: None
  • ZenPack Dependencies: None
  • Installation Notes: zopectl restart; zenhub restart after installing this ZenPack.
  • Configuration: None

History:

Change History:

  • 1.0 initial release
  • 1.1 added wrapper script to handle various check_http arguments
  • 1.2
    • added dmd method manage_addHttpComponent
    • added component attributes "httpUsesSSL" and "httpIp"
  • 1.3 added support for adding arbitrary check_http flags
  • 1.4
    • changed path in wrapper script to use $ZENHOME
    • changed default parser to 'nagios' from 'auto'
  • 1.5
    • added a few options to the inital dialog, including a "Component Name" field that will display in the console
    • added default '-t 30' to flags (30 second timeout)
    • moved 'httpComponents' relation underneath the "device/os/' from directly underneath "device/", addresses an issue with zencheckrels, and will hopefully address occasional issues with relations not being created correctly upon install.
    • UPGRADE WILL CAUSE THE LOSS OF PREVIOUSLY CONFIGURED COMPONENTS!  The following procedure can backup/restore the data:

 

PRIOR TO UPGRADE:

    

1.  Launch 'zendmd' from command line

2.  run the following:

 

httpcomponents = {}

 

for d in dmd.Devices.getSubDevices():

    for h in d.httpComponents():

        httpcomponents[d.id] = {h.id:{'httpPort':h.httpPort,

                                    'httpUrl': h.httpUrl,

                                    'httpPort': h.httpPort,

                                    'httpAuthUser': h.httpAuthUser,

                                    'httpAuthPassword':h.httpAuthPassword,

                                    'httpFindString':h.httpFindString,

                                    'httpJsonPost': h.httpJsonPost,

                                    'httpEventComponent':h.httpEventComponent,

                                    'httpEventKey':h.httpEventKey,

                                    'httpUseSSL':h.httpUseSSL,

                                    'httpPluginFlags':h.httpPluginFlags,

                                    }

                                }

httpcomponents

 

3. Copy the output (httpcomponents) to a text file and save it for later use in step 7.

4.  Uninstall old version of ZenPack, restart zenoss.

5.  Install new version of ZenPack, restart zenoss.

6.  Launch zendmd

7.  at the prompt, type the following:

 

httpcomponents = [paste data from step 3]

 

for d in httpcomonents.keys():

    data = httpcomponents[d]

    device = dmd.Devices.findDevice(d);

    device.manage_addHttpComponent(data['httpEventComponent'],

                                    data['httpPort'],

                                    data['httpUseSSL'],

                                    data['httpUrl'],

                                    data['httpAuthUser'],

                                    data['httpAuthPassword'],

                                    data['httpJsonPost'],

                                    data['httpFindString'],

                                    data['httpPluginFlags'],

                                    data['httpEventKey'],

                                )

commit()

 

8.  Verify that components are created/running as expected.

 

 

Tested: This ZenPack was tested with versions 3.2.1.

Source: https://github.com/j053ph4/ZenPacks.community.zenHttpComponent


Known issues:

Comments (53)