1 #!/bin/ksh |
|
2 # |
|
3 # |
|
4 # CDDL HEADER START |
|
5 # |
|
6 # The contents of this file are subject to the terms of the |
|
7 # Common Development and Distribution License (the "License"). |
|
8 # You may not use this file except in compliance with the License. |
|
9 # |
|
10 # You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE |
|
11 # or http://www.opensolaris.org/os/licensing. |
|
12 # See the License for the specific language governing permissions |
|
13 # and limitations under the License. |
|
14 # |
|
15 # When distributing Covered Code, include this CDDL HEADER in each |
|
16 # file and include the License file at usr/src/OPENSOLARIS.LICENSE. |
|
17 # If applicable, add the following below this CDDL HEADER, with the |
|
18 # fields enclosed by brackets "[]" replaced with your own identifying |
|
19 # information: Portions Copyright [yyyy] [name of copyright owner] |
|
20 # |
|
21 # CDDL HEADER END |
|
22 # |
|
23 # Copyright (c) 2009, 2011, Oracle and/or its affiliates. All rights reserved. |
|
24 # |
|
25 # ident "@(#)svc-net-snmp 1.2 10/10/24 SMI" |
|
26 # |
|
27 # Start method script for the net-snmp SNMP daemon |
|
28 # |
|
29 |
|
30 . /lib/svc/share/smf_include.sh |
|
31 |
|
32 SMF_FMRI=svc:/application/management/net-snmp |
|
33 SNMPD_FILE=/etc/net-snmp/snmp/snmpd.conf |
|
34 SNMPCONFPATH=/etc/net-snmp/snmp:/var/net-snmp |
|
35 MIBDIRS=/etc/net-snmp/snmp/mibs |
|
36 CPU_ARCH=`/usr/bin/arch` |
|
37 |
|
38 export SNMPCONFPATH |
|
39 export MIBDIRS |
|
40 |
|
41 |
|
42 if [ "$CPU_ARCH" == "i86pc" ]; then |
|
43 arch_type=`/bin/svcprop -p general/arch_type $SMF_FMRI` |
|
44 if [ "$arch_type" == "32" ]; then |
|
45 /usr/sbin/i86/snmpd |
|
46 elif [ "$arch_type" == "64" ]; then |
|
47 /usr/sbin/amd64/snmpd |
|
48 elif [ "$arch_type" == "0" ]; then |
|
49 /usr/sbin/snmpd |
|
50 fi |
|
51 elif [ "$CPU_ARCH" == "sun4" ]; then |
|
52 /usr/sbin/snmpd |
|
53 fi |
|