v_upd_sys_rrd 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. #!/bin/bash
  2. # info: updating system rrd charts
  3. #----------------------------------------------------------#
  4. # Variable&Function #
  5. #----------------------------------------------------------#
  6. # Importing system enviroment as we run this script
  7. # mostly by cron wich do not read it by itself
  8. source /etc/profile.d/vesta.sh
  9. # Importing variables
  10. source $VESTA/conf/vars.conf
  11. source $V_CONF/vesta.conf
  12. source $V_FUNC/shared_func.sh
  13. # Another workaround for cron enviroment
  14. PATH="$PATH:$V_BIN"
  15. export PATH
  16. #----------------------------------------------------------#
  17. # Action #
  18. #----------------------------------------------------------#
  19. # Updateing system stats
  20. $V_BIN/v_upd_sys_rrd_la
  21. $V_BIN/v_upd_sys_rrd_net
  22. $V_BIN/v_upd_sys_rrd_mem
  23. $V_BIN/v_upd_sys_rrd_ssh
  24. # Updating web stats
  25. if [ "$WEB_SYSTEM" = 'apache' ]; then
  26. $V_BIN/v_upd_sys_rrd_httpd
  27. fi
  28. if [ "$PROXY_SYSTEM" = 'nginx' ]; then
  29. $V_BIN/v_upd_sys_rrd_nginx
  30. fi
  31. # Updating ftp stats
  32. if [ ! -z "$FTP_SYSTEM" ] && [ "$FTP_SYSTEM" != 'no' ]; then
  33. $V_BIN/v_upd_sys_rrd_ftp
  34. fi
  35. # Updating db stats
  36. if [ ! -z "$DB_SYSTEM" ] && [ "$DB_SYSTEM" != 'no' ]; then
  37. for type in ${DB_SYSTEM//,/ }; do
  38. # Switching on db type
  39. case $type in
  40. mysql) $V_BIN/v_upd_sys_rrd_mysql ;;
  41. pgsql) $V_BIN/v_upd_sys_rrd_pgsql ;;
  42. esac
  43. done
  44. fi
  45. #----------------------------------------------------------#
  46. # Vesta #
  47. #----------------------------------------------------------#
  48. # Logging
  49. log_event 'system' "$V_EVENT"
  50. exit $OK