Caution

This is the documentation for the current development branch of the CometVisu. It is possible that some of the described features are not yet available in the current release.

Also there might be lots of errors in this documentation as some parts of the content have been translated by an online translation service.

Number of process on Linux system

The number of active processes on a Linux system can be filled into an RRD database with this script. This script works as it is stored (and executable) under /var/www/rrd/processes

#!/bin/bash

cd /var/www/rrd

# create database if not exists
[ -f processes.rrd ] || {
/usr/bin/rrdtool create processes.rrd --step 300 \
DS:processes:GAUGE:1200:U:U \
RRA:AVERAGE:0.5:1:3200 \
RRA:AVERAGE:0.5:6:3200 \
RRA:AVERAGE:0.5:36:3200 \
RRA:AVERAGE:0.5:144:3200 \
RRA:AVERAGE:0.5:1008:3200 \
RRA:AVERAGE:0.5:4320:3200 \
RRA:AVERAGE:0.5:52560:3200 \
RRA:AVERAGE:0.5:525600:3200
}

# Use ps and wc to determine the number of processes
PROZESSE=$(ps hax|wc -l)

# Finally, the data comes into the database
# N stands for the current date and time
/usr/bin/rrdtool update processes.rrd N:$PROZESSE

The following line must be added in /etc/crontab to call the script every 5 minutes:

*/5 *   * * *   root    /var/www/rrd/processes