SDR User Guide
This is the installation guide for current version of SDR: 0.71. The current instructions apply to Solaris 10 operating environment.
Installing SDR
SDR package
- Make sure you are under global zone
- $ wget http://www.systemdatarecorder.org/pkgs/sdr.071.solaris10.tar.gz
- Become root
- # cd /opt
- # gzip -dc sdr.071.solaris10.tar.gz | tar xvf -
- check the content of sdr directory, you should have bin, etc, man, log
SDR setenv
If you plan to install SDR to a location different than the default one, /opt/sdr make sure you edit MONITOR_PATH under setenv script to reflect the correct location
SAR
SDR uses SAR, system activity reporter. SAR is started using SMF so these are the main steps in order to get started SAR:
- Enable sar: svcadm enable sar
- Modify sys's crontab: crontab -e sys
If you get this error, when trying to update your sys crontab: "crontab: you are not authorized to use cron. Sorry." then it means you have certain security restrictions in place. Edit cron.allow and cron.deny making sure sys account has been enabled. - 5mins sys crontab: 0,5,10,15,20,25,30,35,40,45,50,55 * * * 0-6 /usr/lib/sa/sa1
SDR Manifests
One very useful feature of SDR under Solaris 10 is SMF: the service management facility, a way to automatic restart your service in case of a failure, maintenance, etc. SDR uses SMF under Solaris 10 automatically but requires its activation. Below there are the steps used to enable SDR under SMF:
Check recorders and all SDR manifests
# svcs -a | grep rec # svcadm disable sysrec # svcadm disable cpurec # svcadm disable netrec # svcadm disable nicrec # svcadm disable zonerec # svcadm disable jvmrec |
Validate and import all SDR smf manifests
# svccfg validate sysrec.xml # svccfg validate cpurec.xml # svccfg validate nicrec.xml # svccfg validate netrec.xml # svccfg validate zonerec.xml # svccfg import sysrec.xml # svccfg import cpurec.xml # svccfg import nicrec.xml # svccfg import netrec.xml # svccfg import zonerec.xml |
Enable each service
# svcadm enable sysrec # svcadm enable cpurec # svcadm enable nicrec # svcadm enable netrec # svcadm enable zonerec |
Check all recorders are online
# svcs -a | grep rec online 16:36:07 svc:/application/sysrec:default online 16:37:43 svc:/application/cpurec:default online 16:37:47 svc:/application/nicrec:default online 16:37:52 svc:/application/netrec:default online 16:37:56 svc:/application/zonerec:default # ptree [...] 3958 /usr/bin/perl -w /opt/sdr/bin/sysrec 60 3972 /bin/perl -w /opt/sdr/bin/cpurec 60 3980 /usr/bin/perl -w /opt/sdr/bin/nicrec 60 3989 /bin/perl -w /opt/sdr/bin/netrec 60 4000 /bin/ksh -p /opt/sdr/bin/zonerec 60 4022 sleep 60 |
Check recorded data: the raw data
# pwd /opt/sdr/log/raw # ls -lrt total 25 -rw-r--r-- 1 root root 342 Oct 31 16:39 cpurec.raw -rw-r--r-- 1 root root 522 Oct 31 16:39 nicrec.raw -rw-r--r-- 1 root root 324 Oct 31 16:39 netrec.raw -rw-r--r-- 1 root root 7552 Oct 31 16:39 zonerec.raw -rw-r--r-- 1 root root 263 Oct 31 16:40 sysrec.raw |
Log Rotation
Enable logadm
Enable for each raw file, a entry for logadm to rotate the file at midnight and to compress the file. For this make sure you are superuser and modify the /etc/logadm.conf file or use logadm utility to add the entries. # SDR Monitoring /opt/sdr/log/raw/sysrec.raw -c -p 1d -z 0 /opt/sdr/log/raw/cpurec.raw -c -p 1d -z 0 /opt/sdr/log/raw/nicrec.raw -c -p 1d -z 0 /opt/sdr/log/raw/netrec.raw -c -p 1d -z 0 /opt/sdr/log/raw/zonerec.raw -c -p 1d -z 0 At the end make sure you check the consistency of the logadm.conf by running: # logadm -V |
root crontab
# crontab -e Add here logadm to be done at 00:05, everyday instead of 3AM and move the raw data compressed into daily directories. # 05 00 * * * /usr/sbin/logadm 10 00 * * * /opt/sdr/bin/raw2day |
Upgrading SDR
If you have already installed SDR, version 0.63 or older make sure you follow the instructions:
Backup config and hook files
- setenv file: sdr/bin/setenv
- raw2day file: sdr/bin/raw2day
- sendHdw file: sdr/bin/sendHdw
Disable each service
# svcadm disable sysrec # svcadm disable cpurec # svcadm disable nicrec # svcadm disable netrec # svcadm disable zonerec |
Extract the new SDR package
- Make sure you are under global zone
- $ wget http://www.systemdatarecorder.org/pkgs/sdr.071.solaris10.tar.gz
- Become root
- # cd /opt
- # gzip -dc sdr.071.solaris10.tar.gz | tar xvf -
- check the content of sdr directory, you should have bin, etc, man, log
SDR setenv
If you plan to install SDR to a location different than the default one, /opt/sdr make sure you edit MONITOR_PATH under setenv script to reflect the correct location
RAW2DAY: ftp, ssh2 hooks
raw2day is used to automatically send data every night to a reporting server. If you use a 24hours time window update policy make sure you restore your raw2day hooks as they were found before the upgrade.
Uninstalling SDR
In order to remove SDR from your system make sure you login in the global zone of the physical machine where you have installed the software. Become root and disable all SDR recorders from smf and delete all its manifests. Make sure as well you delete the log directory, where SDR keeps its recorded data to make room for other applications
Stop all recorders
# svcadm disable sysrec # svcadm disable cpurec # svcadm disable nicrec # svcadm disable netrec # svcadm disable zonerec # svcs -a | grep rec disabled 16:43:55 svc:/application/sysrec:default disabled 16:44:02 svc:/application/cpurec:default disabled 16:44:05 svc:/application/nicrec:default disabled 16:44:08 svc:/application/netrec:default disabled 16:44:11 svc:/application/zonerec:default |
Delete all SDR manifests
# svccfg delete application/sysrec # svccfg delete application/cpurec # svccfg delete application/nicrec # svccfg delete application/netrec # svccfg delete application/zonerec At this moment SMF does not know anymore about SDR # svcs -a | grep rec # |
Last updated: 2009-12-29
Back to main homepage