Lusitaniae/apache_exporter

systemctl status apache_exporter gives this error level=error msg="Error scraping apache: status 404 Not Found (404): <!DOCTYPE HTML PUBLIC \"

vampuhem opened this issue · 9 comments

[root@test ~]# systemctl status apache_exporter

Loaded: loaded (/etc/systemd/system/apache_exporter.service; enabled; vendor preset: disabled)
Active: active (running) since Fri 2021-05-28 15:06:09 UTC; 1h 1min ago
Docs: https://github.com/Lusitaniae/apache_exporter
Main PID: 10089 (apache_exporter)
Tasks: 9
Memory: 4.3M
CGroup: /system.slice/apache_exporter.service
└─10089 /usr/local/bin/apache_exporter --insecure --scrape_uri=http://localhost/server-status/?auto --telemetry.address=0.0.0.0:9117 --telemetry.endpoint=/metrics

May 28 16:05:02 test.elis.abb.com apache_exporter[10089]: time="2021-05-28T16:05:02Z" level=error msg="Error scraping apache: status 404 Not Found (404): <!DOCTYPE HTML PUBLIC "...
May 28 16:05:17 test.elis.abb.com apache_exporter[10089]: time="2021-05-28T16:05:17Z" level=error msg="Error scraping apache: status 404 Not Found (404): <!DOCTYPE HTML PUBLIC "...
May 28 16:05:32 test.elis.abb.com apache_exporter[10089]: time="2021-05-28T16:05:32Z" level=error msg="Error scraping apache: status 404 Not Found (404): <!DOCTYPE HTML PUBLIC "..

/var/log/message show this

ay 28 16:13:02 test apache_exporter: time="2021-05-28T16:13:02Z" level=error msg="Error scraping apache: status 404 Not Found (404): \n\n<title>404 Not Found</title>\n\n

Not Found

\n

The requested URL /server-status/ was not found on this server.

\n\n" source="apache_exporter.go:335"
May 28 16:13:17 test apache_exporter: time="2021-05-28T16:13:17Z" level=error msg="Error scraping apache: status 404 Not Found (404): \n\n<title>404 Not Found</title>\n\n

Not Found

\n

The requested URL /server-status/ was not found on this server.

\n\n" source="apache_exporter.go:335"

Any suggestions how this can be fixed

server is rhel 7.9 (Maipo).

This is the apache exporter config.

#cat /etc/systemd/system/apache_exporter.service
[Unit]
Description=Prometheus
Documentation=https://github.com/Lusitaniae/apache_exporter
Wants=network-online.target
After=network-online.target

[Service]
Type=simple
User=prometheus
Group=prometheus
ExecReload=/bin/kill -HUP $MAINPID
ExecStart=/usr/local/bin/apache_exporter
--insecure
--scrape_uri=http://localhost/server-status/?auto
--telemetry.address=0.0.0.0:9117
--telemetry.endpoint=/metrics

SyslogIdentifier=apache_exporter
Restart=always

[Install]
WantedBy=multi-user.target

image
Have you seen the FAQ in the readme?

Are you able to access http://localhost/server-status/?auto using curl?

If not, have you configured Apache to enable the status page?

Hi Team,

could not find the above configuration in httpd.conf file.

#curl http://localhost/server-status/?auto
Total Accesses: 19334
Total kBytes: 11091
CPULoad: .00127338
Uptime: 163345
ReqPerSec: .118363
BytesPerSec: 69.5288
BytesPerReq: 587.42
BusyWorkers: 1
IdleWorkers: 5
Scoreboard: ___W..........................................................................................................................................................................................................................................................

Hi Team,

Yes we have a separate file created for server status.

#cat server-status.conf
<Location "/server-status">
SetHandler server-status
#Require host localhost

We need to mention these details either in httpd.conf or in a separte file like above.

Regards,

Is apache exporter running in the same server?

Why curl works and apache exporter cannot connect to it?

Yes, Grfana/prometheus and apache exporter are running on the same server.

if you run apache_exporter manually (instead of systyemd)

Do you see any errors?

Closing since there's no updates