Newsletter:4/Monitor All The Apache Virtualhosts

From Zenoss Wiki
Jump to: navigation, search

Monitor All the Apache Virtualhosts

Monitoring virtualhosts on the same IP in Apache isn't obvious, we'll show you how to do it right!
Feather.png

Apache supports multiple virtual websites on a single IP address. Zenoss only monitors one website per IP address, what should I do!?!

Installing the ZenPack

You will need the HTTP Monitor ZenPack, which is included with Zenoss Core in the $ZENHOME/packs directory. As the Zenoss user run:

$ zenpack --install ZenPacks.zenoss.HttpMonitor-2.1.0-py2.7.egg

Remember to restart Zenoss after you install the ZenPack.

$ zenoss restart

Configuring MultiSite

Bulbgraph.png Note: All screen shots for the examples are below.

Bulbgraph.png Note: Always add the base server OS separately before adding virtual sites. There will be a new folder under Infrastructure/Devices called "HTTP". To configure this folder to manage virtual sites, first edit the Configuration Properties for the HTTP device class and set zPingMonitorIgnore to true. Next create a subdevice class under HTTP; I have used ourshack in the screenshots below. This is so we can have a slightly different template for devices supporting multiple webservers. Under "Advanced -> Monitoring Templates", select HttpMonitor (/Devices) and use the Action icon to select "Copy / Override Template" and choose /HTTP/ourshack as the destination device class. Once created, select the new template and remove ${dev/manangeIp} from "IP Address or Proxy Address:" You should also set the Hostname field to ${dev/title}. You may wish to change the cycle time for the template.

Steps to Add Each Site

  1. Add a device under your prepared device class, with an id field that is neither an IP address nor a resolvable hostname. For example, for the website www.skills-1st.co.uk, you could use www_skills-1st_co_uk . Set the title field to the resolvable name of the website eg. www.skills-1st.co.uk .
  2. Ensure that the "Model Device" box is NOT checked
  3. Test with zencommand:
$ zencommand run -v 10 -d <devicename>

Bulbgraph.png Note: Ensure that data is being collected regularly. Behaviour has been observed whereby a standalone zencommand succeeds but regular data collection fails, apparently due to the device's template configuration not being found for the collector to use. RRD datafiles for the template can be seen under $ZENHOME/perf/Devices/<device id> .

Bulbgraph.png Note: This procedure was tested on Zenoss Core 4.2.5 SUP 203.

Credits

Thanks to long-time community member, Zenoss Master, and L2 support engineer Ryan Matte for assisting with this article. The article was updated by Zenoss Master, Jane Curry.

Http-folder.PNG
Pingmonitorignore.PNG
Http datasource.jpg
Add http device.jpg
Zencommandoutput.PNG

Thanks

The Apache HTTP server is (c) the Apache Software Foundation under the Apache 2.0 License. For more Information: [1]

The Apache Software Foundation Feather is (TM) the Apache Software Foundation and is used here to denote the software referenced in the article.