Moodle with postgres

Dashboard

Dashboard for moodle with postgresql. - system overview - apache overview - postgresl ovelview - number of moodle users
Last updated: 6 months ago

Downloads: 54

Reviews: 0

  • Firefox_Screenshot_2020-06-07T08-56-27.765Z.png
    Firefox_Screenshot_2020-06-07T08-56-27.765Z.png
  • Firefox_Screenshot_2020-06-07T09-01-08.267Z.png
    Firefox_Screenshot_2020-06-07T09-01-08.267Z.png

Dashboard for telegraf, influxDB and Graana

Inputs for telegraf :

[[inputs.cpu]]
[[inputs.disk]]
[[inputs.diskio]]
[[inputs.kernel]]
[[inputs.mem]]
[[inputs.processes]]
[[inputs.swap]]
[[inputs.system]]
[[inputs.exec]]
[[inputs.apache]]
[[inputs.postgresql]]

Collector Configuration Details

Add a script to take number of moodle users like this :

#!/bin/bash

timestamp_now=`date --utc +"%s"`
timestamp_start=$(($timestamp_now - 60))

QUERY="SELECT COUNT(*) 
    FROM mdl_user 
    WHERE deleted=0 AND lastaccess > "$timestamp_start" AND lastaccess < "$timestamp_now" ;"
RESULT=$(psql -d 'moodle' -c "$QUERY" 2>/dev/null)
RESULT_CUT=$(echo $RESULT | cut -d ' ' -f 3)
echo "nUsersMoodle, nUsersMoodle=$RESULT_CUT" 
  • user telegraf mus thave read access to database
Dependencies: