Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- nmon -s 300 -c 288
- #!/bin/bash
- # nmon_log_rot_db.sh
- # Variables
- # nmon
- NMON = '/usr/local/bin/nmon/nmon'
- # Log Directory
- LOGDIR = '/var/log/nmon/'
- # Hostname
- HOST = '/etc/hostname'
- # Date
- DATE = '/usr/bin/date +%y%m%d'
- # File Name
- FILE = ${LOGDIR}/${HOST}-${DATE}.nmon
- # Kill current nmon process
- command to kill nmon_log_rot_db.sh
- ???
- # Log to Database
- # connect to database
- HOSTNAME = mysqlhost;
- DBUSER = dbuser;
- DBPASS = dbpass;
- DBNAME = dbname;
- # network table
- ROW_ID|datetime|hostname|iface|rx KB/s|tx KB/s
- # cpu table
- ROW_ID|datetime|hostname|USER%|SYS%|WAIT%|IDLE
- # mem table
- ROW_ID|datetime|hostname|type (system or swap)|Total|Free|Used
- # disk table
- ROW_ID|datetime|hostname|disk_dev|busy|read|write
- # Delete old log file
- rm ${OLD_FILE}
- # Start nmon
- ${NMON} -F ${FILE} -s 300 -c 288
- 0 0 * * * /opt/nmon/nmon -f -s 60 -c 1440 -T -m /opt/nmon/nmon_logs/
- 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