5. Daily checks
By the end of this chapter: You find warning signs early with a 5-minute check once a day.
Time: 10 min
5.1 Three logs to read first
| Log | Content | Read it first when |
|---|---|---|
~/gritdb1/log/grit_admin_main.log |
Supervisor process — starting, stopping, and watching child processes | Start or stop behaves strangely |
~/gritdb1/log/grit_admin_stdout.log |
Screen output of the supervisor process and the GritDB engine — rewritten at every start | GritDB stops right after it starts |
~/gritdb1/log/postgresql.log |
PostgreSQL server log | Connection or SQL errors |
- Other
grit_*.logfiles andGRIT_SURFER_ASSERT.logare engine internal logs. Collect all of them when a failure occurs (7.4). - GritDB rewrites
grit_admin_stdout.logat every start, so if a problem occurs, collect diagnostic data (7.4) before you start GritDB again.
Format of one GritDB log line:
[2026-10-01 09:00:00.000000][INFO][tid:12345][grit_admin_main.cpp::main:119] GritAdmin: starting (pid=12345)
| Field | Example | Meaning |
|---|---|---|
| Timestamp | [2026-10-01 09:00:00.000000] |
Down to microseconds |
| Level | [INFO] |
INFO, WARN, or ERROR |
| Thread | [tid:12345] |
Thread number |
| Location | [grit_admin_main.cpp::main:119] |
File, function, and line |
| Message | GritAdmin: starting (pid=12345) |
Original message text — use it to search chapter 7 |
5.2 Five daily checks
-
Processes — Are the four processes running?
ps -o pid,comm -p "$(cut -d: -f2 ~/gritdb1/run/grit_admin.pid | paste -sd,)"It is normal if four lines appear under the header:
GritAdmin,postgres,GritCatalog, andGritSurfer. If lines are missing, do not restart. See GDB-RUNTIME-004. -
Connection — Does PostgreSQL accept connections?
~/gritdb1/bin/pg_isready -p 5432It is normal if
accepting connectionsappears. -
Disk usage
df -h ~/gritdb1/datafilesIt is normal if
Use%is below 80%. Otherwise, plan for more disk space. If the disk is full, see GDB-RUNTIME-002. -
Data size trend
du -sh ~/gritdb1/datafiles/*It is normal if there is no sudden growth compared with the previous day’s record. If
pgdatakeeps growing regardless of the amount of loaded data, see Admin, chapter 7. -
ERROR count for today — Line 1 counts errors in the GritDB logs, and line 2 counts errors in the PostgreSQL log.
grep -h "^\[$(date +%F)" ~/gritdb1/log/grit_*.log* | grep -c "\]\[ERROR\]\[" grep -c "^$(date +%F).*ERROR:" ~/gritdb1/log/postgresql.logIt is normal if the count is about the same as the previous day. If the count jumps, open those lines and search chapter 7 for the error text.
If you set up logrotate for
postgresql.log(Admin, chapter 9), use the line below instead of line 2. Today’s lines written before the rotation are inpostgresql.log.1.cat ~/gritdb1/log/postgresql.log.1 ~/gritdb1/log/postgresql.log 2>/dev/null | grep -c "^$(date +%F).*ERROR:"
5.3 Check record
Record the results in the same table every day. You can judge a “sudden growth” only when you can see the trend.
| Date | Processes | Connection | Disk % | datafiles size | ERROR (GritDB / PG) | Checked by |
|---|---|---|---|---|---|---|
| (Example) 2026-10-01 | 4 | OK | 42% | 120G | 0 / 2 | J. Doe |
Learn more
- For all metrics, thresholds, and weekly and monthly checks, see Admin, chapter 7.
- For log retention and rotation, see Admin, chapter 9.