Advertisement
Guest User

Untitled

a guest
Apr 17th, 2017
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.93 KB | None | 0 0
  1. nmon -s 300 -c 288
  2.  
  3. #!/bin/bash
  4. # nmon_log_rot_db.sh
  5.  
  6. # Variables
  7.  
  8. # nmon
  9. NMON = '/usr/local/bin/nmon/nmon'
  10. # Log Directory
  11. LOGDIR = '/var/log/nmon/'
  12. # Hostname
  13. HOST = '/etc/hostname'
  14. # Date
  15. DATE = '/usr/bin/date +%y%m%d'
  16. # File Name
  17. FILE = ${LOGDIR}/${HOST}-${DATE}.nmon
  18.  
  19. # Kill current nmon process
  20. command to kill nmon_log_rot_db.sh
  21. ???
  22.  
  23. # Log to Database
  24. # connect to database
  25. HOSTNAME = mysqlhost;
  26. DBUSER = dbuser;
  27. DBPASS = dbpass;
  28. DBNAME = dbname;
  29.  
  30.  
  31. # network table
  32. ROW_ID|datetime|hostname|iface|rx KB/s|tx KB/s
  33.  
  34. # cpu table
  35. ROW_ID|datetime|hostname|USER%|SYS%|WAIT%|IDLE
  36.  
  37. # mem table
  38. ROW_ID|datetime|hostname|type (system or swap)|Total|Free|Used
  39.  
  40. # disk table
  41. ROW_ID|datetime|hostname|disk_dev|busy|read|write
  42.  
  43. # Delete old log file
  44. rm ${OLD_FILE}
  45.  
  46. # Start nmon
  47. ${NMON} -F ${FILE} -s 300 -c 288
  48.  
  49. 0 0 * * * /opt/nmon/nmon -f -s 60 -c 1440 -T -m /opt/nmon/nmon_logs/
  50.  
  51. 0 0 * * * /opt/nmon/nmon -f -s 300 -c 288 -T -m /opt/nmon/nmon_logs/
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement