Prometheus init script for CentOS 6

Create init file. touch /etc/rc.d/init.d/prometheus chmod 755 /etc/rc.d/init.d/prometheus vi /etc/rc.d/init.d/prometheus Add following #!/bin/bash # # /etc/rc.d/init.d/prometheus # # Prometheus monitoring server # # chkconfig: 2345 20 80 Read # description: Prometheus monitoring server # processname: prometheus # Source function library. . /etc/rc.d/init.d/functions PROGNAME=prometheus PROG=/usr/hostonnet/prometheus/$PROGNAME USER=prometheus LOGFILE=/var/log/prometheus.log DATADIR=/usr/hostonnet/prometheus/data LOCKFILE=/var/run/$PROGNAME.pid CONFIG_FILE=/usr/hostonnet/prometheus/prometheus.yml ALERT_MGR_URL=localhost:9093 start() { echo -n “Starting … Read more

Prometheus Node Exporter on non default port

To run Prometheus Node Exporter on custom port, use /usr/local/bin/node_exporter –web.listen-address=:9101 Here is systemctl service script i used [root@cdn 1945]# cat /etc/systemd/system/node_exporter.service [Unit] Description=Node Exporter Wants=network-online.target After=network-online.target [Service] User=node_exporter Group=node_exporter Type=simple ExecStart=/usr/local/bin/node_exporter –web.listen-address=:9101 [Install] WantedBy=multi-user.target [root@cdn 1945]# Related Posts Prometheus Server Monitoring

Monitor Server with Prometheus and Grafana

grafana dashboard

Prometheus is used an open source software, that can collect metrics and alerting. You can download latest version oof Prometheus from https://prometheus.io/download/ Create a user useradd –no-create-home –system –shell /bin/false prometheus Download and Install prometheus cd /usr/local/src wget https://github.com/prometheus/prometheus/releases/download/v2.31.0-rc.1/prometheus-2.31.0-rc.1.linux-amd64.tar.gz tar xvf prometheus-2.31.0-rc.1.linux-amd64.tar.gz cd prometheus-2.31.0-rc.1.linux-amd64 mv prometheus /usr/local/bin/ mv promtool /usr/local/bin/ mkdir /etc/prometheus mkdir /var/lib/prometheus mv … Read more