Hello,
I’m trying to monitor PosgreSQL autovacuums per 1 or 5 minutes to get a graph, without alerting (without thresholds).
I already have the request to get a number (from DB start I guess) with “--mode=sql” :
```
/usr/lib/centreon/plugins/centreon_postgresql.pl --plugin=database::postgres::plugin --mode=sql --host=HOSTNAME --username='monitoring' --password='secret' --port='5432' --database='dbname' --sql-statement="SELECT SUM(autovacuum_count) AS total_autovacuum FROM pg_stat_all_tables"
OK: SQL statement result : 113703. | 'value'=113703;;;; 'sqlrequest.execution.time.seconds'=0.008s;;;0;
```
Or with “--mode=collection” too with a custom JSON file. I know this mode have a retention mode in statefile but I don’t know how to use it to get previous value to subtract it to current value to have a ratio from last check.
How can I do that? Maybe I don’t use the right check and a better way exists?