| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566 |
- #!/bin/bash
- # info: updating system rrd charts
- #----------------------------------------------------------#
- # Variable&Function #
- #----------------------------------------------------------#
- # Importing system enviroment as we run this script
- # mostly by cron wich do not read it by itself
- source /etc/profile.d/vesta.sh
- # Importing variables
- source $VESTA/conf/vars.conf
- source $V_CONF/vesta.conf
- source $V_FUNC/shared_func.sh
- # Another workaround for cron enviroment
- PATH="$PATH:$V_BIN"
- export PATH
- #----------------------------------------------------------#
- # Action #
- #----------------------------------------------------------#
- # Updateing system stats
- $V_BIN/v_upd_sys_rrd_la
- $V_BIN/v_upd_sys_rrd_net
- $V_BIN/v_upd_sys_rrd_mem
- $V_BIN/v_upd_sys_rrd_ssh
- # Updating web stats
- if [ "$WEB_SYSTEM" = 'apache' ]; then
- $V_BIN/v_upd_sys_rrd_httpd
- fi
- if [ "$PROXY_SYSTEM" = 'nginx' ]; then
- $V_BIN/v_upd_sys_rrd_nginx
- fi
- # Updating ftp stats
- if [ ! -z "$FTP_SYSTEM" ] && [ "$FTP_SYSTEM" != 'no' ]; then
- $V_BIN/v_upd_sys_rrd_ftp
- fi
- # Updating db stats
- if [ ! -z "$DB_SYSTEM" ] && [ "$DB_SYSTEM" != 'no' ]; then
- for type in ${DB_SYSTEM//,/ }; do
- # Switching on db type
- case $type in
- mysql) $V_BIN/v_upd_sys_rrd_mysql ;;
- pgsql) $V_BIN/v_upd_sys_rrd_pgsql ;;
- esac
- done
- fi
- #----------------------------------------------------------#
- # Vesta #
- #----------------------------------------------------------#
- # Logging
- log_event 'system' "$V_EVENT"
- exit $OK
|