My requirement is to monitor a Linode Virtual machine that contains Apache using Prometheus and Grafana. (PS - Prometheus and Grafana are running in a seperate Linode VM)
I used the following document to install Apache exporter : https://www.techbeginner.in/2021/01/install-and-configure-apache-node.html. The service file is like this :
[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
I've changed the --scrape_uri to http://usr_name:password@localhost/server-status/?auto \ and --telemetry.address to 127.0.0.1:9117 though I'm sure it wouldn't make any difference. Prometheus is able to scrape the data. But when I import a grafana dashboard (ID - 3894) to visualize the data, I don't get any data. Among 7 panels in the entire dashboard (Current total kbytes sent, Current total apache accesses, Apache scoreboard statuses Apache worker statuses, Apache CPU load, Uptime and Apache Up/Down), I can see the grapf for Apache Up/Down. The other 6 say no data available.
This is the prometheus.yml config:
#Apache Servers
- job_name: apache-web-server
static_configs:
- targets: ['x.x.x.x:9117']
labels:
alias: server-apache
PS - Both the Linode instances contain Debian GNU/Linux 9.8 (stretch) as their OS.
What am I missing here? How can I get the graphs for the rest of the panels? Any and all help is appreciated. Thanks a lot in advance.