My custom tricks!

Created: April 25, 2020, 2:37 p.m.
Update: July 9, 2020, 11:12 a.m.
Command line for monitoring

My custom tricks! I love line commands for monitoring something!

Usually enviromment

Linux Debian OR Ubuntu
Python
Bash

How to monitoring a total of register from a table? Total COUNT in postgreSQL
create a file with the command content

$ echo "SELECT COUNT(*) FROM client_client WHERE confirmed=1;"  > /tmp/command.sql

Print date time and total of occurences 5 to 5 minutes, sleep command work's in seconds

$ su - postgres 
$ while [ -z ]; do date && psql -d mydatabase < /tmp/command.sql; sleep 300; done
crtl+c to out
output
Sat 25 Apr 2020 02:22:58 PM -03
count 
-------
7608
(1 row)
Sat 25 Apr 2020 02:27:58 PM -03
count 
-------
7613
(1 row)
Sat 25 Apr 2020 02:32:58 PM -03
count 
-------
7620
(1 row)

The best traffic monitoring
iptraf-ng

Tiago de Souza Moraes - teago.futuria.com.br - 2020 // CSS by UIKIT CSS