Description of problem:
The apache plugin incorrectly determines what SNMP stats to collect if 2 virtual hosts (or a main server config and a virtual host) share the same IP and port (and are differentiated only by hostname).
Steps to Reproduce:
1. Add a vhost to apache config that will listen on the same ip and port as the main server, define the ServerName directive for the vhost to some hostname resolvable to the IP
2. enable SNMP monitoring in the apache config
3. inventory the apache instance
4. create some traffic on both the main server and the vhost
5. see if the stats contain the correct values
the main server and the vhost have the same stats
the main server and the vhost should have different stats based on the actual traffic to each.
Fixed in commit b824d63
Lukas, any reason this can't be on-qa?
I have my SNMP set up and from all I can tell, things are listening....
[root@jiaozi ~]# nmap -sV -sU -p 1610 localhost
Starting Nmap 5.21 ( http://nmap.org ) at 2010-06-29 13:52 EDT
Nmap scan report for localhost (127.0.0.1)
Host is up.
Hostname localhost resolves to 2 IPs. Only scanned 127.0.0.1
rDNS record for 127.0.0.1: localhost.localdomain
PORT STATE SERVICE VERSION
1610/udp open snmp SNMPv1 server (public)
Service Info: Host: jiaozi.usersys.redhat.com
Service detection performed. Please report any incorrect results at http://nmap.org/submit/ .
Nmap done: 1 IP address (1 host up) scanned in 44.79 seconds
And all my virtualhosts are "green"....
That said, I have been clicking through on and off throughout the day, and I still have "No Metric Data Available" in the graphs for any of the given vhosts (Bytes/Requests?Responses, etc.)
hmmm... this would mean that the plugin doesn't match the virtualhosts with their snmp indexes correctly. Could you attach your httpd.conf and associated files please?
The algorithm to match the vhost resource with the snmp index was indeed failing.
This was because the snmp module somewhat confusingly represents the default port 80 as "0" and at the same time uses "0" to represent the port wildcard. This could be classified as a bug in the snmp module.
Nevertheless, commit ed06919 works around that deficiency and hardens the matching algorithm to take that behaviour into account as well as not failing on unknown hosts (this enables to match everything up correctly even if the apache configuration contains some misconfigured entries).
Clearing the needinfo flag, because it's no longer needed.
I installed the latest build and am still getting "No Metric Data Available". Did this fix go into the release branch?
I can't make this not work... I replicated your setup precisely and I always get the data collected eventually.
Not sure what would be the problem with your snmp setup because it looks ok from what i've seen.
I made sure that the following works:
- multiple vhosts domain names resolve to the IP of the agent box and get resolved correctly
- _default_ gets resolved
- * ports get resolved
Finally got this to work on a separate httpd server. Something must be
wrong with the original one because the two have nearly identical
httpd.conf files, but one won't run with "Listen 80", and the other
won't run without it....
In any case, with this other httpd, I did successfully see the statistical differences. QA Verified!
Mass-closure of verified bugs against JON.