1. Introduction to the System Management Agent
2. Configuring the System Management Agent
3. Working with the System Management Agent
Starting and Stopping the System Management Agent
To Start the System Management Agent
To Restart the System Management Agent
To Stop the System Management Agent
Common Operations With the System Management Agent
To Check Whether Another Process Is Running on the SMA Port
To View the Status of the Agent
To See Which MIBs Are Initialized
Configuration and Proxying With JDMK
Port 161 is reserved for the System Management Agent. For more information, see Managing Configuration With the Main Configuration File.
# netstat -anv|grep 161
If a value of 161 is returned, a process is already bound to port 161.
# svcs svc:/application/management/sma:default
A typical response to this command is shown:
STATE STIME FMRI online Aug_24 svc:/application/management/sma:default
First find the total disk space of the disk, then find how much of this space is used. The difference between these two totals is the available disk space.
# snmpwalk -v1 -c public hostname HOST-RESOURCES-MIB::hrStorageIndex
This command returns a list of disks on the host, hostname:
HOST-RESOURCES-MIB::hrStorageIndex.1 = INTEGER: 1 HOST-RESOURCES-MIB::hrStorageIndex.2 = INTEGER: 2 HOST-RESOURCES-MIB::hrStorageIndex.3 = INTEGER: 3 HOST-RESOURCES-MIB::hrStorageIndex.4 = INTEGER: 4 HOST-RESOURCES-MIB::hrStorageIndex.5 = INTEGER: 5 HOST-RESOURCES-MIB::hrStorageIndex.6 = INTEGER: 6 HOST-RESOURCES-MIB::hrStorageIndex.7 = INTEGER: 7 HOST-RESOURCES-MIB::hrStorageIndex.8 = INTEGER: 8 HOST-RESOURCES-MIB::hrStorageIndex.9 = INTEGER: 9 HOST-RESOURCES-MIB::hrStorageIndex.10 = INTEGER: 10 HOST-RESOURCES-MIB::hrStorageIndex.101 = INTEGER: 101 HOST-RESOURCES-MIB::hrStorageIndex.102 = INTEGER: 102
The disk is indicated by the index number:
HOST-RESOURCES-MIB::hrStorageIndex.1 = INTEGER: 1
This output represents disk 1, /dev/dsk/c0t0d0s0
The following command would retrieve the total storage space for disk 1:
# snmpget -v1 -c public hostname HOST-RESOURCES-MIB::hrStorageSize.1
This command returns the total disk space at the end of the line:
HOST-RESOURCES-MIB::hrStorageSize.1 = INTEGER: 2561695
# snmpwalk -v1 -c public hostname HOST-RESOURCES-MIB::hrStorageUsed
HOST-RESOURCES-MIB::hrStorageUsed.1 = INTEGER: 2121747 HOST-RESOURCES-MIB::hrStorageUsed.2 = INTEGER: 0 HOST-RESOURCES-MIB::hrStorageUsed.3 = INTEGER: 0 HOST-RESOURCES-MIB::hrStorageUsed.4 = INTEGER: 0 HOST-RESOURCES-MIB::hrStorageUsed.5 = INTEGER: 11 HOST-RESOURCES-MIB::hrStorageUsed.6 = INTEGER: 48 HOST-RESOURCES-MIB::hrStorageUsed.7 = INTEGER: 1892576 HOST-RESOURCES-MIB::hrStorageUsed.8 = INTEGER: 0 HOST-RESOURCES-MIB::hrStorageUsed.9 = INTEGER: 130565552 HOST-RESOURCES-MIB::hrStorageUsed.10 = INTEGER: 26036932 HOST-RESOURCES-MIB::hrStorageUsed.101 = INTEGER: 55995 HOST-RESOURCES-MIB::hrStorageUsed.102 = INTEGER: 17171
# snmpget -v1 -c public hostname HOST-RESOURCES-MIB::hrStorageUsed.1
This command returns the disk space used on disk 1:
HOST-RESOURCES-MIB::hrStorageUsed.1 = INTEGER: 2121747
2561695 – 2121747 = 439948
In the same way as you would use the netstat command, you can check the status of the network using the System Management Agent with the snmpnetstat command.
To show the state of all sockets, use the snmpnetstat command with the –a option. This option provides the default display, showing all active sockets, except those used by server processes.
# snmpnetstat -v 2c -c public -a testhost
The following information, including local and remote addresses, and protocols, is typically displayed:
Active Internet (tcp) Connections (including servers) Proto Local Address Foreign Address (state) tcp *.echo *.* LISTEN tcp *.discard *.* LISTEN tcp *.daytime *.* LISTEN tcp *.chargen *.* LISTEN tcp *.ftp *.* LISTEN tcp *.telnet *.* LISTEN tcp *.smtp *.* LISTEN Active Internet (udp) Connections Proto Local Address udp *.echo udp *.discard udp *.daytime udp *.chargen udp *.time
To show the state of network interfaces, use the snmpnetstat command with the –i option. This option provides a statistics table that shows packets transferred, errors, and collisions as well as network addresses of the interface and the maximum transmission units (MTU).
# snmpnetstat -v 2c -c public -i testhost
The following table, including local and remote addresses, and protocols, is typically displayed:
Name Mtu Network Address Ipkts Ierrs Opkts Oerrs Queue eri0 1500 10.6.9/24 testhost 170548881 245601 687976 0 0 lo0 8232 127 localhost 7530982 0 7530982 0 0
Note - The Ipkts, or incoming packets, value reported by the snmpnetstat command is not identical to that reported by the netstat command. The snmpnetstat command displays the total number of unicast, multicast and broadcast packets. The netstat command displays the total number of unicast and multicast packets, omitting broadcast packets.