# AIX/Linux Monitoring with njmon

nimon (NOT njmon) + InfluxDB + Grafana

- njmon = JSON output
- nimon = njmon but straight to InfluxDB

> NOTE: as of version 78, the njmon and nimon have been merged into one binary file.
> 
> Using the option `-J` (nimon mode) or `-I` (nimon mode).

##### njmon

Download: [http://nmon.sourceforge.net/pmwiki.php?n=Site.Njmon](http://nmon.sourceforge.net/pmwiki.php?n=Site.Njmon)

##### InfluxDB

Create a new database for njmon

```SQL
create database aix_njmon with duration 180d
create user mon with password 'thisispassword'
grant ALL on aix_njmon to mon
show GRANTS for mon
```

##### Grafana

Dashboards

- [njmon for AIX Large Set v66](https://grafana.com/grafana/dashboards/14509)
    - Plugin Clock: [https://grafana.com/grafana/plugins/grafana-clock-panel/](https://grafana.com/grafana/plugins/grafana-clock-panel/)
    - Plugin Pie Chart: [https://grafana.com/grafana/plugins/grafana-piechart-panel/](https://grafana.com/grafana/plugins/grafana-piechart-panel/)
- [njmon for AIX Simple Six PLUS Copy V78](https://grafana.com/grafana/dashboards/13701)
    - Plugin Clock: [https://grafana.com/grafana/plugins/grafana-clock-panel/](https://grafana.com/grafana/plugins/grafana-clock-panel/)
- [njmon Linux Simple Six Plus v67](https://grafana.com/grafana/dashboards/10844)
    - Plugin Clock: [https://grafana.com/grafana/plugins/grafana-clock-panel/](https://grafana.com/grafana/plugins/grafana-clock-panel/)

##### AIX/Linux

Cron job:

```
## Gathing AIX/Linux performance data with njmon
# Running forever, in case the process is killed the cron job will restart it every one hour.
# -i : the hostname of InfluxDB
# -x : the DB name in InfluxDB
# -y : the DB user
# -z : the DB password
3 * * * * /usr/local/bin/njmon -I -s 60 -k -i <ip-or-hostname-to-InfluxDB> -x <db-name> -y <db-user> -z <db-pass> > /dev/null 2>&1
```