v_upd_sys_rrd 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  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_CONF/vesta.conf
  13. source $V_FUNC/shared.func
  14. # Another workaround for cron enviroment
  15. PATH="$PATH:$V_BIN"
  16. export PATH
  17. #----------------------------------------------------------#
  18. # Action #
  19. #----------------------------------------------------------#
  20. # Updateing system stats
  21. $V_BIN/v_upd_sys_rrd_la
  22. $V_BIN/v_upd_sys_rrd_net
  23. $V_BIN/v_upd_sys_rrd_mem
  24. $V_BIN/v_upd_sys_rrd_ssh
  25. # Updating web stats
  26. if [ "$WEB_SYSTEM" = 'apache' ]; then
  27. $V_BIN/v_upd_sys_rrd_httpd
  28. fi
  29. if [ "$PROXY_SYSTEM" = 'nginx' ]; then
  30. $V_BIN/v_upd_sys_rrd_nginx
  31. fi
  32. # Updating ftp stats
  33. if [ ! -z "$FTP_SYSTEM" ] && [ "$FTP_SYSTEM" != 'no' ]; then
  34. $V_BIN/v_upd_sys_rrd_ftp
  35. fi
  36. # Updating db stats
  37. if [ ! -z "$DB_SYSTEM" ] && [ "$DB_SYSTEM" != 'no' ]; then
  38. for type in ${DB_SYSTEM//,/ }; do
  39. # Switching on db type
  40. case $type in
  41. mysql) $V_BIN/v_upd_sys_rrd_mysql ;;
  42. pgsql) $V_BIN/v_upd_sys_rrd_pgsql ;;
  43. esac
  44. done
  45. fi
  46. #----------------------------------------------------------#
  47. # Vesta #
  48. #----------------------------------------------------------#
  49. # Logging
  50. log_event 'system' "$V_EVENT"
  51. exit