We are using webserver monitoring extension to monitor an Apache webserver
How can we enable user authentication in the extension - this does not appear to be documented.
Release : 20.x, 21.x
Component :
Assuming authentication is defined similar to this in the httpd.conf
<Location /server-status>
SetHandler server-status
Order deny,allow
Allow from all
AuthType Basic
AuthName "Please login to access server status part"
AuthUserFile /etc/httpd/.htpasswd
Require valid-user
</Location>
then the user credentials can be passed in using the http header section in the WebServerConfig.xml entry e.g.
<WebServer Type="Apache" Enabled="true" ServerURL="http://myhost" DisplayName="" RefreshFrequencyInSeconds="30" MetricsURL="server-status/">
<HttpHeaders>
<HttpHeader name="Authorization" value = "Basic =="/>
</HttpHeaders>
</WebServer>
the encrypted password string can be obtained using base64 e.g.
# echo -n user:password |base64
==
and the connection tested outside the agent using curl
# curl -H "Authorization: Basic ==" http://myhost/server-status