NjmonAixV83ManualPage


njmon for AIX version 83 Manual Page


If you install with the "ninstall" supplied simple shell script as root user, it installs the manual pages for njmon and nimon (the same page covers both).

Access with the regular UNIX/Linux command: man njmon


njmon & nimon(1)              General Commands Manual             njmon & nimon(1)

NAME
       njmon and nimon are the same program

       - njmon: save performance statistics in JSON format.

       - nimon: save same stats in InfluxDB Line Protocol format.

BRIEFLY
       Performance statistics agent outputting in

       - JSON format for Time-Series databases including InfluxDB.

       - InfluxDB Line Protocol format directly to InfluxDB.

       Default is stdout to allow using a shell pipe to other commands.

       The ninstall shell script puts njmon and nimon into /usr/lbin.

       The nmeasure programs allow adding your own data to InfluxDB.

Version
       Version: 83

SYNOPSIS
       Core options to save to save the statistics to a file.
              njmon -s seconds -c count [-m directory -f]

       Other options
              -a  file  -b -B -c count -C -d -D -e -h -k -K pidfile -L -V -n -o -O
              org -P -q tags -r -R -t percent -T token -u -U -v -W -? -@ -!

       njmon specific options
              -i njmond-hostname -p njmond-portno -e -I

       nimon specific options
              -i InfluxDB-hostname [-p InfluxDB-portno] [-x InfluxDB-database] [-y
              InfluxDB-username [-z InfluxDB-password]] -H  -w -J

DESCRIPTION
       These are the njmon command options in alphabetical order.

       -a file
              Read  the  command  line  arguments from a file (so no passwords are
              seen in the ps command output).  Place just  the  command  arguments
              into  a  config file (not including the command name).  Use the same
              arguments, all on the first line, space separated.  Only have the -a
              option on the actual command line. Example:

       nimon -c 1440 -s 60 -i myinflux -x njmon -y fred -z abc123
              Create  a file called njmon.conf: -c 1440 -s 60 -i myinflux -x njmon
              -y fred -z abc123 Then run the command: njmon  -a  njmon.conf  Note:
              user  and  and passwords need to be setup in the InfluxDB configura‐
              tion (not used much).

       -A hostname
              User supplied host override - ignoring  the  actual  hostname.  Some
              people have different servers with the same hostname!

       -b     For  Process  stats,  switch  off  adding  pid to the process names:
              "ksh_76927" becomes "ksh".  This can help if you want to add up  the
              the numbers for all processes with the same name.

       -B     Adds  extra  raw mode statistics - without maths to convert to aver‐
              ages or rates in the last period.  These are not user  friendly  but
              can help if you want to do the maths.  Look for measures and statis‐
              tics containing "raw".

       -c count
              Number of snapshots of the statistice to save and then stop (default
              forever).

       -C     Shared  CPU/Processor Pool, you need to enable performance data col‐
              lection on the HMC.

       -d     Switch on debugging output. Note the may ruin the JSON or line  pro‐
              tocol format.  So also use the -f option to saved to a file.

       -D     Skip dangerous libperfstat function that can cause problems.  Tempo‐
              rary fix for some older AIX versions.

       -e     NJMON mode only. Switch on elastic mode (also called  elasticsearch,
              ELK stack) with sub-arrays (with []) instead of sub-JSON data struc‐
              tures for variable numbers of  resources  like  filesystems,  disks,
              networks etc.

       -f file
              Output to file (not stdout) to two files below:

              NJMON  saves to hostname_<year><month><day>_<hour><minutes>.json NI‐
              MON saves to hostname_<year><month><day>_<hour><minutes>.influxlp

              Debug &  Errors  are  saved  hostname_<year><month><day>_<hour><min‐
              utes>.err

              In  NIMON  mode:  If you add a second "f" like "-ff" or "-f -f" then
              the .influxlp output file has a nano seconds since epoch start time‐
              stamp  at  the end of every measure.  This should allow it to be in‐
              serted in to the InfluxDB using the "influx" command.

              In NJMON mode: If you add a second "f" like -ff or -f -f  then  each
              snapshot   has  its  own  file.   The  file  name  format  is  host‐
              name_<year><month><day>_<hour><minutes>_<6    digit    sequence_num‐
              ber>.json.   The  sequence  number starts at 000000. There is only a
              single error file.

       -H     NIMON mode only. This option makes nimon send to InfluxDB  the  full
              hostname  (as  the  host  tag).   The short hostname is the default.
              This is important if many servers have the same short name  in  dif‐
              ferent   domains.   For  example,  myserver.achme.com  normally  has
              host=myserver.  With the -H option the Fully Qualified  Domain  Name
              (FQDN)i  s  used host=myserver.achme.com.  With NJMON mode the host‐
              name is extracted from the stats by njmond.py.   If  you  need  full
              hostnames tags for JSON data modify the njmond.py program.

       -h     Output these hints, help details and then stop.

       -i IP-Address or -i Hostname
              NJMON mode: IP Address or Hostname of the central server running nj‐
              mond.py.

              NIMON mode.  IP Address or Hostname of the InfluxDB server.

       -I     Force switch to running in NIMON mode  (regardless  of  the  command
              name used) for InfluxDB Line Prootocl output format.

       -J     Force  switch  to  running  in NJMON mode (regardless of the command
              name used) for JSON output format.

       -k     If the file /tmp/njmon.pid is not found this  njmon  continues  run‐
              ning.  For  nimon the file is called /tmp/nimon.pid.  If the file is
              found, the process PID is read from it & if it  is  found  that  the
              process is running then this njmon (or nimon) silently exits.  If no
              process is found running with this PID  then  this  njmon  continues
              running.  This allows you to try starting njmon or nimon say once an
              hour from crontab.  This will restart the njmon or nimon only if the
              previous  one stopped.  njmon/nimon will remove the njmon.pid or ni‐
              mon.pid file when it stops normally.  njmon/nimon   will  produce  a
              warning and stop, if it detects the .pid file but can't gain access.
              Usually, due to not being the file owner or having  the  wrong  file
              permisions.

       -K pidfile
              This is same as the -k option but the user decides the directory and
              filename for the file containing the Process Identity (PID).   Also,
              you  can  run  multiple  njmon processes, using different PID files.
              Some users prefer to use a file in, for example, /var/logs but  that
              requires root access.  Others prefer to avoid /tmp and use /home/nj‐
              mon.  njmon will produce a warning and stop, if it detects the  .pid
              file  but  can't  gain  access.   Usually, due to not being the file
              owner or having the wrong file permisions.

       -L     Don't collect Logical Volume stats  to  reduce  the  CPU  processing
              time.  If not the root user then these are silently switched off.

       -m directory
              The program will change to the directory before creating files.

       -n     No  PID  for  the child procees if printed out at start up.  I child
              process is create to make a new process group so that  this  program
              does not get stopped if you log out.

       -o     If using Oracle ASM raw disks have zero size.  This options requests
              using "bootinfo -s" to find out the ASM disk sizes.

       -O org Set the organisation. This is use in nimon mode and required for In‐
              fluxDB  2+.  InfluxDB 2+ uses this to separate datam users and dash‐
              boards.  This could ne a company name, if hostinf for more than one.
              Or a department name or group os users or a workload.

       -p port-number
              NJMON  mode.   Network  port number of the central njmond.py server.
              Many users use 8181 as the port number.

              NIMON mode.  Network port number of the InfluxDB server. If not  set
              the default InfluxDB port number of 8086 is used.  The InfluxDB port
              number can be set in the InfluxDB config file.

       -P     Switch on the collection of process statistics (Note: these  can  be
              very  large).   Processes  using less than the CPU threshold are ig‐
              nored. See -t percent option.  This reduces the collection  of  sta‐
              tistics for processes not using any CPU time.

       -q influxDB-tags
              The  tag format is a comma separated tagname=tagvalue both parts are
              strings. No double or single  quotes.   For  example:  -q  dept=foo‐
              bar,area=51  This  option adds user defined tags that might include:
              location, owner, workload, department spp, ssp  or  HAcluster.   See
              InfluxDB  documentation  for the definition of the Line Protocol tag
              syntax.  No spaces are allowed in the tags string.

              New in njmon version 81 there is a new tags measure contaning origi‐
              nal  and  user  defined  tags.  These can be added to Grafana single
              stats text boxes.

              NIMON mode.  nimon InfluxDB default tags are: hostname,  os,  archi‐
              tecture,  serial_no,  mtm and now includes the additional tags auto‐
              matically.  There is also a new measure called tags with keys of the
              default tags and additional tags with "_tag" added to the names.

              NJMON  mode.  njmon when sending data to InfluxDB via njmond has In‐
              fluxDB tags are: hostname,  os,  architecture,  serial_no  and  mtm.
              These are extracted from the JSON data by njmond.  njmond would need
              to be changed to add the additional tags.  njmond may be updated  in
              the future to use these  the tags measuremen for the tags.

       -r     Random  pause  at the start. Stops cron starting every njmon in sync
              on many endpoints (VM) with network time protocal.

       -R     Reduced mode, don't collect  CPU  core  thread:  logical  CPUs  like
              cpu_logicals, cpu_physicals, syscall stats nor netbuffers.

       -s seconds
              Seconds between snapshots of data (default 60 seconds).

       -t percent
              Process CPU cut-off threshold percent. Default 0.001.  Processes us‐
              ing less than this value are not included in  the  statistics  thuse
              removing  processes  using  no (or very little) CPU clock cycles and
              drastically reducing the data for proesses.

       -T token
              For NIMON mode, InfluxDB 2+ uses a different REST API and  this  op‐
              tion  switches  NIMON to the the API.  The Security Token is foun in
              the InfluxDB 2+ CLI or GUI. It is about 50 characters (Lower and up‐
              percase  and  numbers  and some symbol letters). See also the -O org
              optio.

       -v     Only available if njmon or nimon compiled with VIOS support. Compile
              with -D VIOS This adds VIOS virtual disk and networks statistics.

       -u     Only  available if njmon compiled with VIOS support. Compile with -D
              SSP This adds VIOS Shared Storage Pools (SSP) statistics.

       -U     Only available if njmon compiled with VIOS support. Compile with  -D
              SSP  This  adds  VIOS Shared Storage Pools (SSP) statistics for each
              node.

       -V     Don't collect Volume Group stats to reduce the CPU processing  time.
              If not the root user then these are silently switched off.

       -w     NIMON  mode only. Switch on InfluxDB telegraf output mode, Which ex‐
              cludes the HTTP POST string.

       -W     Ignore warning messages. Use this to supress messages that  you  you
              no longer want to see.

       -x database
              NIMON  mode  only.  InfluxDB database name (created with influx com‐
              mand then: create database njmon and exit).  Note: nimon  and  njmon
              can  share  the same database and it is normally called "njmon".  If
              not specified "njmon" is the default.   In  InfluxDB2  this  is  now
              called a bucket.

       -y username
              NIMON  mode  only.   InfluxDB  server  username  for authentication.
              Mandatory, if you have set up InfluxDB to enforce username and pass‐
              word autentication.  The Default is no username and password is nec‐
              essary and the username is ignored.

       -z password
              NIMON mode  only.   InfluxDB  server  password  for  authentication.
              Mandatory, if you have set up InfluxDB to enforce username and pass‐
              word autentication.  The Default is no username and password is nec‐
              essary and the password is ignored.

       -?     Same as the -h Help option.

       -!     Output  the full version information and stop.  For example: Version
              njmon4AIX7-v80-13/05/2022

       -@     Switch on Workload Manager stats (see wlmstat command)

       Notes on Spectrum Scale (GPFS)
              njmon automatically collects  GPFS  if  /usr/lpp/mmfs/bin/mmksh  and
              /usr/lpp/mmfs/bin/mmpmon  are found on the system.  However, if GPFS
              is present but off it can get confused.  Use: export NOGPFS=1 to set
              a  shell  variable  before  running njmon or nimon will disable GPFS
              stats.  You can also compile out GPFS support with -D NOGPFS

EXAMPLES for using njmon
       1 Simple use
              Every minute (60 seconds), all day  (1440  minutes),  njmond  server
              hostname, default InfluxDB port (8181).

       1 Syntax
              njmon -s 60 -c 1440 -i centralbox -p 8181

       2 Piping the JSON output in to a data handler
              Every  1  minute  (-c  60) all day (1440 minutes in a day), InfluxDB
              server hostname influxbox, default InfluxDB port (-p 8086) and user‐
              name /password.

       2 Syntax
              njmon -s 60 -c 1440 | myprog

       3 Add prosses and remove LVM data
              Add process statistics (-P) and remove LV + VG data (-LV).

       3 Syntax
              njmon -s60 -c 1440 -PLV -i centralbox -p 8181

       4 Every half minute
              Collect  statistics  twice  a  minute (-s 30) and all day (2880 half
              minutes in a day).

       4 Syntax
              njmon -s30 -c 2880 -i centralbox -p 8181

       5 Add VIOS statistics
              Adding VIOS extra statistics for virtual resources and including SSP
              - requires njmon version with VIOS compiled in.

       5 Syntax
              njmon -s30 -c 2880 -vuU -i centralbox -p 8181

       6 Crontab
              Crontab  entry start at 4 minutes after midnight, save data every 30
              seconds for a day.

       6 Syntax
              4 0 * * * /usr/lbin/njmon -s30 -c 2880 -vuU -i  centralbox  -p  8181
              2>/dev/null

       7 Crontab with kill option
              Crontab  entry starting hourly and checking if the previous njmon is
              still running (if it is this njmon stops itself). This  uses  a  PID
              file called /tmp/njmon.pid.

       7 Syntax
              0 * * * * /usr/lbin/njmon -s 60 -k -i centralbox -p 8181 2>/dev/null

       8 Using a PID file
              Naming a PID file so it is not in /tmp which might be erased

       8 Syntax
              0 * * * * /usr/lbin/njmon -s 60 -K /home/nag/njmon.pid -i centralbox
              -p 8181  2>/den/null

       9 Saving to a local file
              Save the njmon data to take a file (-f).  This file can be loaded in
              to  InfluxDB later with njmon2influx.py. The two files will end .err
              and .influxlp (lp = Line Protocol).

       9 Syntax
              njmon -s 10 -c 30  -f

       10 Saving to a file and a specific directory
              njmon moves to the directory /tmp before creating  any  files.  Save
              the  njmon  data  to take a file (-f).  This can be loaded in to In‐
              fluxDB later.

       10 Syntax
              njmon -s 60 -c 1440 -m /tmp -f

       11     Use ssh to start the njmonagent on a  remote  endpoint,  return  the
              data over ssh and pipe to the InfluxDB

       11 Syntax
              0 * * * * /usr/bin/ssh /usr/lbin/njmon -s 15 -c 5760 | /usr/lbin/nj‐
              mon2influxturbo.py

       12 Using a conf file
              Using a configuration file to contain  the  njmon  arguments.   This
              means  the arguments are not seen in the ps command output.  Use the
              -a argument-file option.

       12 Syntax
              For example command line: /usr/lbin/njmon -a /etc/njmon.conf

       12 An example /etc/njmon.config file contains just the options:

       -s 60 -c 1440 -i centralbox -p 8181

       13 Output the version njmon and stop

       13 Syntax
              njmon -!

EXAMPLES for using nimon
       1 Simple use
              Every minute (60 seconds), all day (1440 minutes),  InfluxDB  server
              hostname, default InfluxDB port (8086), database njmon.

       1 Syntax
              nimon -s 60 -c 1440 -i influxbox -x njmon

       2 With user & password
              Every  1  minute  (-c  60)  all day (1440 minuts in a day), InfluxDB
              server hostname influxbox, InfluxDB port (-p 8086) and  username  /p
              assword.

       2 Syntax
              nimon -s 60 -c 1440 -i influxbox -p 8086 -x njmon -y Nigel -z passwd

       3  Add prosses and remove LVM data - assuming the database of njmon and the
       InfluxDB port of 8086
              Add process statistics (-P) and remove LV + VG data (-LV).

       3 Syntax
              nimon -s60 -c 1440 -PLV -i influxbox

       4 Every half minute with a non-default port of 8888
              Collect statistics twice a minute (-s 30) and  all  day  (2880  half
              minutes in a day).

       4 Syntax
              nimon -s30 -c 2880 -i influxbox -p 8888 -x njmon

       5 Add VIOS statistics
              Adding VIOS extra statistics for virtual resources and including SSP
              - requires nimon version with VIOS compiled in.

       5 Syntax
              nimon -s30 -c 2880 -vuU -i influxbox

       6 Crontab
              Crontab entry start at 4 minutes after midnight, save data every  30
              seconds for a day.

       6 Syntax
              4 0 * * * /usr/lbin/nimon -s30 -c 2880 -vuU -i influxbox 2>/dev/null

       7 Crontab with kill option
              Crontab  entry starting hourly and checking if the previous nimon is
              still running (if it is this nimon stops itself). This  uses  a  PID
              file called /tmp/nimon.pid.

       7 Syntax
              0 * * * * /usr/lbin/nimon -s 60 -k -i influxbox 2>/dev/null

       8 Using a PID file
              Naming a PID file so it is not in /tmp which might be erased

       8 Syntax
              0  * * * * /usr/lbin/nimon -s 60 -K /home/nag/nimon.pid -i influxbox
              2>/dev/null

       9 Saving to a local file
              Save the nimon data to take a file  (-f).   This  file  can  not  be
              loaded  in to InfluxDB due to it not having time and date stamp. The
              data and time are added by InfluxDB as th e data is loaded. The  two
              files will end .err and .influxlp (lp = Line Protocol).

       9 Syntax
              nimon -s 10 -c 3  -f

       10 Saving to a file and a specific directory
              nimon  moves  to  the directory /tmp before creating any files. Save
              the nimon data to take a file (-f).  This can not be  loaded  in  to
              InfluxDB

       10 Syntax
              nimon -s 1 -c 3 -m /tmp -f

       11 Prometheus, elastic (ELK) and Splunk support
              Send  data  to  telegraf  and then onto Prometheus, elastic (ELK) or
              Splunk.  You will have to set up telegraf  with  an  InfluxDB  input
              plugin  and  an  output  plugin  of  type  Prometheus.   Then  point
              Prometheus at the telegraf server to collect the data.  Similar  for
              elastic and Splunk.

       11 Syntax
              nimon -s 15 -c 5760 -w -i telegraf_server -p 8888

       12 Using a conf file
              Using  a  configuration  file  to contain the nimon arguments.  This
              means the arguments are not seen in the ps command output.  Use  the
              -a argument-file option.

       12 Syntax
              For example command line: /usr/lbin/nimon -a /etc/njmon.conf

       12 An example /etc/njmon.config file contains just the options:

       -s 60 -c 1440 -i influxbox

       13 Output the version nimon and stop

       13 Syntax
              nimon -@

       14 Simple example but using InfluxDB 2+

       10 Syntax
              nimon -k -s 30 -i influx_hostname -O IBM -T HyS7g1TT-...KK==

SIGNALS
       Dynamically, toggle on verbose debug output using SIGUSR1. This is good for
       problem determination and njmon development.

       kill -USR1 <njmon-pid>

FILES
       /usr/lbin/njmon
              The executable command

SEE ALSO
       nimon(1) nimon is like njmon but outputs InfluxDB Line Protocol data.

       Online njmon Manual website
              See http://nmon.sourceforge.net/pmwiki.php?n=Site.NjmonManualPage

       njmon Download Project website
              From http://nmon.sourceforge.net/pmwiki.php?n=Site.Njmon

       AIXpert Blog Articles on nimon and njmon
              https://ibm.biz/AIXpertBlog

       perfstat Library website
              This  is  the  source  of  most  of  the  statistics   documentation
              https://www.ibm.com/support/knowledgecenter/ssw_aix_72/filesrefer‐
              ence/libperfstat.h.html

       Grafana dashboards (assuming InfluxDB hold the data)
              https://grafana.com/grafana/dashboards?search=njmon

AUTHOR
       Nigel Griffiths nigelargriffiths@hotmail.com @mr_nmon

BUGS
       None, of course.  But just in case, please report issues to the  author  by
       email.

                                   AIX and VIOS                   njmon & nimon(1)