# Monitoring Using Prometheus Agents

Depending on which OS, the application running, install Prometheus agent by using respective OS agent.

## Installation

### a) Node Exporter Installation on Linux:

Step 1: Download Prometheus agent from url&#x20;

```
wget https://github.com/prometheus/node_exporter/releases/download/v0.18.1/node_exporter-0.18.1.linux-amd64.tar.gz
```

Step 2: Extract tar file&#x20;

```
tar -zxf node_exporter-0.18.1.linux-amd64.tar.gz
```

Step 3: Navigate to the directory

```
cd node_exporter-0.18.1.linux-amd64
cp node_exporter /usr/local/bin/
```

Step 4: Update node\_exporter.service by navigating the folder as shown below

```
vi /etc/systemd/system/node_exporter.service
```

```
[Unit]
Description=Node Exporter
After=network.target
 
[Service]
User=root
Group=root
Type=simple
ExecStart=/usr/local/bin/node_exporter  --collector.bcache --collector.bonding --collector.conntrack --collector.cpu --collector.cpufreq --collector.diskstats --collector.drbd --collector.edac --collector.entropy --collector.filefd --collector.filesystem --collector.hwmon --collector.infiniband --collector.interrupts --collector.ipvs --collector.ksmd --collector.loadavg --collector.logind --collector.mdadm --collector.meminfo --collector.meminfo_numa --collector.mountstats --collector.netclass --collector.netdev --collector.netstat --collector.nfs --collector.nfsd --collector.ntp --collector.pressure --collector.processes --collector.qdisc --collector.runit --collector.sockstat --collector.stat --collector.supervisord --collector.systemd --collector.tcpstat --collector.time --collector.timex --collector.uname --collector.filesystem.ignored-mount-points="" --collector.perf --collector.diskstats.ignored-devices=""

 
[Install]
WantedBy=multi-user.target
```

Step 5: Provision as Linux Service

```
sudo systemctl daemon-reload
sudo systemctl start node_exporter
sudo systemctl status node_exporter
```

Step 6: Update firewall ports and restart firewall service

```
sudo firewall-cmd --permanent --add-port=9100/tcp
sudo firewall-cmd --reload
```

### b) Prometheus Exporter for RabbitMQ Installation on Linux

Check Prometheus exporter for RabbitMQ metrics <https://github.com/kbudde/rabbitmq_exporter/releases/tag/v1.0.0-RC6>

Step1: Download agent&#x20;

```
wget https://github.com/kbudde/rabbitmq_exporter/releases/download/v0.29.0/rabbitmq_exporter-0.29.0.linux-amd64.tar.gz
```

Step 2: Extract rar file

```
tar -zxf rabbitmq_exporter-0.29.0.linux-amd64.tar.gz
```

Step 3: Navigate to the directory

```
cd rabbitmq_exporter-0.29.0.linux-amd64
```

Step 4: Copy rabbimq\_exporter to /usr/local.bin

```
cp rabbitmq_exporter /usr/local/bin/
```

Step 5: Open rabbtmq\_exporter.service for editing and update the properties including port number

```
vi /etc/systemd/system/rabbitmq_exporter.service
```

```
[Unit]
Description=Node Exporter
After=network.target

[Service]
User=root
Group=root
Type=simple
Environment=RABBIT_CAPABILITIES=bert,no_sort \
ExecStart=/usr/local/bin/rabbitmq_exporter \
RABBIT_EXPORTERS="[exchange node overview queue connection cluster shovel]"\
PUBLISH_PORT=9090

[Install]
WantedBy=multi-user.target
```

Step 6: Provision as linux service and update firewall rules

```
systemctl daemon-reload
systemctl start rabbitmq_exporter
systemctl status rabbitmq_exporter
```

Step 7: Update firewall ports and reload service

```
firewall-cmd --permanent --add-port=9090/tcp
firewall-cmd --reload
```

### c) Process Exporter

Please click here for more information on process exporter <https://github.com/ncabatoff/process-exporter>.

Step 1: Download agent

```
 wget https://github.com/ncabatoff/process-exporter/releases/download/v0.5.0/process-exporter_0.5.0_linux_386.rpm
```

Step 2: Extract the file

```
# rpm -ivh process-exporter_0.5.0_linux_386.rpm
```

Step 3: open all.yaml file and update the process names.

```
process_names:
  - name: "{{.ExeFull}}"
    cmdline:
    - '.+'
```

Step 4: Provision as Linux service

```
#systemctl daemon-reload
#systemctl start process-exporter
#systemctl status process-exporter
```

Step 5: Update firewalls and ports. Default port is 9256

```
# firewall-cmd --permanent --add-port=9256/tcp
# firewall-cmd --reload
```

### d) Prometheus exporter for windows machines using WMI.

Step 1: Download the msi file

```
https://github.com/martinlindhe/wmi_exporter/releases/download/v0.9.0/wmi_exporter-0.9.0-amd64.msi
```

Step 2: Open powershell and execute the following commands. Please note the commands differ for windows, IIS, MSSQL, etc and are mentioned below as sub-steps&#x20;

Step 2a: For Windows Only

```
msiexec /i <path-to-msi-file> ENABLED_COLLECTORS=os,cpu,cs,dns,logical_disk,memory,net,process,service,system,tcp LISTEN_PORT=9182
```

Step 2b: For IIS only

```
msiexec /i <path-to-msi-file> ENABLED_COLLECTORS=os,cpu,cs,dns,logical_disk,memory,net,process,service,system,tcp,iis LISTEN_PORT=9182
```

Step 2c: For MSSQL

```
msiexec /i <path-to-msi-file> ENABLED_COLLECTORS=os,cpu,cs,dns,logical_disk,memory,net,process,service,system,tcp,mssql LISTEN_PORT=9182
```

Step 2d: For all-in one VM

```
msiexec /i <path-to-msi-file> ENABLED_COLLECTORS=os,cpu,cs,dns,logical_disk,memory,net,process,service,system,tcp,iis,mssql LISTEN_PORT=9182
```

Step 3: You need to enable the respective port in firewall.

Note: We cannot run multiple wmi\_exporter in single vm, before executing the command, please check if it needs to be enabled for  IIS and MSSql etc.

### e) Prometheus Exporter for Oracle on Linux

Please refer the exporter at Github: <https://github.com/iamseth/oracledb_exporter>

Step 1: In order to run, you'll need the Oracle Instant Client Basic for your operating system. Only the basic version is required for execution.<br>

Link for Oracle Instant Client Basic:  <https://www.oracle.com/database/technologies/instant-client/downloads.html>.&#x20;

Select the zip file based on your os type and download the Basic Package (ZIP) Version 18.5.0.0.0 (any zip file in this version) download zip file.  At the end of the page, you will have will have steps to how to Installation of ZIP files. Follow those steps carefully.<br>

Step 2: Download the Oracle db exporter agent

```
 wget https://github.com/iamseth/oracledb_exporter/releases/download/0.2.2/oracledb_exporter.0.2.2.linux-amd64.tar.gz
```

Step 3: Extract the file

```
# tar -zxf oracledb_exporter.0.2.2.linux-amd64.tar.gz
# cd oracledb_exporter.0.2.2.linux-amd64
# nohup ./oracledb_exporter -default.metrics=/home/oracle/oracledb_exporter.0.2.2.linux-amd64/default-metrics.toml  -web.listen-address :9161 &
```

Step 4: Enable firewall ports, 9162 is the default port

```
# firewall-cmd --permanent --add-port=9162/tcp
# firewall-cmd --reload
```

Step 5: Additional information, set the following paths as an example

```
export ORACLE_HOSTNAME=<Fully Qualified Domain Name>
export ORACLE_UNQNAME=test1 <unique name chosen>
export ORACLE_BASE=/u01/app/oracle
export ORACLE_HOME=$ORACLE_BASE/product/12.1.0/dbhome_1
export ORACLE_SID=test1
export PATH=/usr/sbin:$PATH
export PATH=$ORACLE_HOME/bin:$PATH
export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib:/opt/glibc-2.14/lib:/u01/app/oracle/instantclient_18_5/instantclient_18_5
```

<br>
