• install netsnmp pkg-get -i netsmp
  • create a configuration file /opt/csw/share/snmp/snmpd.conf
rocommunity  public
disk  /atlashome 5%
load  12 6 3
syslocation  ATLAS
syscontact  atlas-admin
sysservices 76
exec harddrive  /var/lib/monitoring/show_snmp.sh 1
exec harddrive  /var/lib/monitoring/show_snmp.sh 2
exec harddrive  /var/lib/monitoring/show_snmp.sh 3
exec harddrive  /var/lib/monitoring/show_snmp.sh 4
exec harddrive  /var/lib/monitoring/show_snmp.sh 5
exec harddrive  /var/lib/monitoring/show_snmp.sh 6
exec harddrive  /var/lib/monitoring/show_snmp.sh 7
exec harddrive  /var/lib/monitoring/system.sh 8

  • write the script /var/lib/monitoring/show_snmp.sh

#!/bin/sh
n=0
for i in `cut -d " " -f $1 /tmp/snmp`;do
  printf "p$n:$i "
  n=`echo "$n+1"| bc`
done

  • write also the script /var/lib/monitoring/system.sh

#!/bin/sh


zpool status -x | grep -v "all pools are healthy"  > /tmp/system
/usr/sbin/fmadm faulty >> /tmp/system
/usr/bin/wc -l /tmp/system
  • another script must be started regularly as a cron job:

#!/bin/sh

file1=/tmp/snmp_tmp
file2=/tmp/snmp

/usr/bin/iostat -xn 30 2 | tail -50| /opt/csw/bin/gawk '/c[0145678]t/ {print $1" "$2" "$3" "$4" "$9" "$10" "$11}' > $file1
/usr/bin/mv $file1 $file2
<verbatim>
   * start the SNMP agent with <i>/opt/csw/sbin/snmpd -c /opt/csw/share/snmp/snmpd.conf</i>

-- Main.HenningFehrmann - 10 Sep 2009
</verbatim>
<nop>

DocumentationForm edit

Title SolarisSNMP
Description Setup a SNMP agent on solaris
Tags
Category Admin
This topic: ATLAS > WebHome > GeneralDocumentation > SolarisSNMP
Topic revision: 10 Feb 2012, ArthurVarkentin
This site is powered by FoswikiCopyright © by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding Foswiki? Send feedback