components/net-snmp/sun/masfcnv.1m
changeset 4435 b497cc6685f1
equal deleted inserted replaced
4434:c35bb70ab3d8 4435:b497cc6685f1
       
     1 '\" te
       
     2 .\" Copyright (c) 2008, 2012, Oracle and/or its affiliates. All rights reserved.
       
     3 .TH masfcnv 1M "7 May 2012" "SunOS 5.12" "System Administration Commands"
       
     4 .SH NAME
       
     5 masfcnv \- SNMP configuration migration script
       
     6 .SH SYNOPSIS
       
     7 .LP
       
     8 .nf
       
     9 \fB/usr/lib/net-snmp/masfcnv\fR [\fB-cimnrs\fR] [\fB-l\fR \fIagent\fR\fImaster\fR] 
       
    10      [\fB-p\fR \fIenable\fR\fIdisable\fR\fIerror\fR] [\fB-t\fR \fInone\fR\fIadd\fR] 
       
    11      [\fB-u\fR \fIagent\fR\fImaster\fR\fIerror\fR] [\fB-y\fR \fIagent\fR\fImaster\fR\fIerror\fR]
       
    12 .fi
       
    13 
       
    14 .LP
       
    15 .nf
       
    16 \fBmasfcnv\fR [\fB-V\fR]
       
    17 .fi
       
    18 
       
    19 .LP
       
    20 .nf
       
    21 \fBmasfcnv\fR [\fB-?\fR]
       
    22 .fi
       
    23 
       
    24 .SH DESCRIPTION
       
    25 .sp
       
    26 .LP
       
    27 The \fBmasfcnv\fR script is used to assist the system administrator in migrating an existing set of configuration files for the Sun SNMP Management Agent for Sun Fire and Netra Systems (MASF) to the Systems Management Agent (SMA).
       
    28 .sp
       
    29 .LP
       
    30 The script accepts as input the currently installed set of MASF and SMA configuration files and outputs a new set of SMA configuration files. Existing SMA configuration files are backed up by appending \fB\&.bak\fR to the filename. The administrator can choose to output the new configuration to standard output, instead of replacing the current configuration, by specifying the \fB-n\fR option.
       
    31 .sp
       
    32 .LP
       
    33 The migration script must be run as the superuser. Failure to do so causes the script to exit with an error message. Before running the script you should ensure that both the SMA and MASF agents are not running. If the agents are running they will be shut down by the script.
       
    34 .sp
       
    35 .LP
       
    36 The migration script installs a new startup script for the MASF agent in \fB/etc/init.d\fR, as well as a backup of the old script. During migration, MASF will be configured as an AgentX subagent of SMA. All migration settings will be migrated to the SMA configuration file.
       
    37 .sp
       
    38 .LP
       
    39 The migration script aborts if any unrecognized directives are found in either the MASF configuration files or the SMA configuration files. This can be overridden with the \fB-i\fR option. If this option is selected, the behavior is to retain unrecognized directives that were present in the SMA configuration, but remove those present in the MASF configuration.
       
    40 .sp
       
    41 .LP
       
    42 The migration script then proceeds to migrate access control and trap configuration. As a side effect of running the migration script, the following directives might be expanded by the script into multiple directives with an equivalent interpretation:
       
    43 .RS +4
       
    44 .TP
       
    45 .ie t \(bu
       
    46 .el o
       
    47 \fBrwcommunity\fR
       
    48 .RE
       
    49 .RS +4
       
    50 .TP
       
    51 .ie t \(bu
       
    52 .el o
       
    53 \fBrocommunity\fR
       
    54 .RE
       
    55 .RS +4
       
    56 .TP
       
    57 .ie t \(bu
       
    58 .el o
       
    59 \fBrwuser\fR
       
    60 .RE
       
    61 .RS +4
       
    62 .TP
       
    63 .ie t \(bu
       
    64 .el o
       
    65 \fBrouser\fR
       
    66 .RE
       
    67 .RS +4
       
    68 .TP
       
    69 .ie t \(bu
       
    70 .el o
       
    71 \fBtrapcommunity\fR
       
    72 .RE
       
    73 .RS +4
       
    74 .TP
       
    75 .ie t \(bu
       
    76 .el o
       
    77 \fBtrapsink\fR
       
    78 .RE
       
    79 .RS +4
       
    80 .TP
       
    81 .ie t \(bu
       
    82 .el o
       
    83 \fBtrap2sink\fR
       
    84 .RE
       
    85 .RS +4
       
    86 .TP
       
    87 .ie t \(bu
       
    88 .el o
       
    89 \fBinformsink\fR
       
    90 .RE
       
    91 .SS "Access Control Migration"
       
    92 .sp
       
    93 .LP
       
    94 Access control directives are expanded into the equivalent com2sec, group, access and view directives. Existing group names are renamed by prepending a prefix to avoid conflict with any which may already be defined in SMA.
       
    95 .sp
       
    96 .LP
       
    97 When migrating SNMPv1 or v2c access control, a conflict can occur if both MASF and SMA configuration files have defined access permissions for the same community and source address. The default behavior is to abort with a message, unless a use of the \fB-y\fR option specifies otherwise. If \fB-y\fR \fBagent\fR is specified then the MASF configuration takes precedence. If \fB-y\fR \fBmaster\fR is specified then the SMA configuration is retained.
       
    98 .sp
       
    99 .LP
       
   100 When migrating USM configuration (SNMPv3), a conflict can occur if both SMA and MASF configurations define a user with the same \fBsecurityName\fR. If this occurs, the behavior of the script is determined by the \fB-u\fR option. If \fB-u\fR \fBagent\fR is specified, the configuration of the user defined in the MASF configuration files is the one that is retained. Otherwise, if the \fB-u\fR \fBmaster\fR option is specified, the use defined in the SMA configuration files is retained.
       
   101 .sp
       
   102 .LP
       
   103 By default, the migration script attempts to migrate USM users from MASF to SMA. The script determines whether there are any SNMPv3 users present in the SMA configuration and whether the default \fBengineID\fR has been overridden in the SMA configuration files. If neither of these conditions obtain, then the any \fBusmUser\fR statements containing localized authentication keys can be migrated to SMA, along with the MASF \fBengineID\fR. This results in the \fBengineID\fR of the SMA master agent changing.
       
   104 .sp
       
   105 .LP
       
   106 If the script determines that there are existing SNMPv3 users or a manually configured \fBengineID\fR present in the SMA configuration, only those users defined in \fBcreateUser\fR statements are transferred. Those users that were defined in \fBusmUser\fR statements are transferred but will have their passwords reset to a random value. You should notify your users of their new password or reset the password yourself by editing the newly-generated configuration file.
       
   107 .SS "Trap/Inform Migration"
       
   108 .sp
       
   109 .LP
       
   110 The migration script performs a check to determine whether a trap destination defined for MASF is already specified in an existing SMA \fBtrapsink\fR, \fBtrap2sink\fR or \fBinformsink\fR directive. If this is the case, then the directive in the MASF configuration will be discarded to avoid duplicate traps/informs being received.
       
   111 .sp
       
   112 .LP
       
   113 \fBtrapsink\fR, \fBtrap2sink\fR and \fBinformsink\fR directives specified in the existing SMA configuration are considered valid destinations for MASF traps/informs and will receive them from the MASF subagent after migration.
       
   114 .sp
       
   115 .LP
       
   116 If the \fB-t\fR \fBnone\fR option was specified on the command line, the migration script carries over any remaining MASF trap/inform directives without modification.
       
   117 .sp
       
   118 .LP
       
   119 If the \fB-t\fR \fBadd\fR option was specified (the default), the migration script expands any \fBtrapsink\fR, \fBtrap2sink\fR, or \fBinformsink\fR directives to use the \fBTARGET-MIB\fR and \fBNOTIFICATION-MIB\fR. The \fBTARGET-MIB\fR specifies targets using IP addresses, so it might be desirable to use the \fB-t\fR \fBnone\fR option if, for example, the network allocates IP addresses to hostnames dynamically by means of DHCP.
       
   120 .sp
       
   121 .LP
       
   122 The expanded directives defines filters specific to the MASF agent so that traps from other subagents will not be received by migrated trap destinations. Existing filters present in the SMA configuration are, by default, not modified and might or might not receive MASF traps, depending upon the filters that were originally defined for them.
       
   123 .sp
       
   124 .LP
       
   125 If the \fB-l\fR option is specified, any filters already defined in the \fBTARGET-MIB\fR and the \fBNOTIFICATION-MIB\fR for SMA are extended to include traps from MASF. In the event that a trap destination is already configured in the \fBTARGET-MIB\fR with the same target address and community as an existing MASF trap/inform sink, a conflict will arise.
       
   126 .sp
       
   127 .LP
       
   128 If \fB-l\fR \fBagent\fR was specified and a conflict arises, the migration script uses the target SNMP parameters (that is, the SNMP version and choice of trap/inform) defined by the MASF \fBtrap\fR/\fBinformsink\fR directive to send traps to this destination. Otherwise, if the \fB-l\fR \fBmaster\fR option was specified, the conflict will be resolved using the target SNMP parameters specified in the SMA configuration.
       
   129 .SS "Miscellaneous"
       
   130 .sp
       
   131 .LP
       
   132 If the migration script encounters in the MASF configuration file any of the directives listed below and the directives are either not present or differ from the SMA configuration, the script will log a warning message.
       
   133 .RS +4
       
   134 .TP
       
   135 .ie t \(bu
       
   136 .el o
       
   137 \fBsyslocation\fR
       
   138 .RE
       
   139 .RS +4
       
   140 .TP
       
   141 .ie t \(bu
       
   142 .el o
       
   143 \fBsyscontact\fR
       
   144 .RE
       
   145 .RS +4
       
   146 .TP
       
   147 .ie t \(bu
       
   148 .el o
       
   149 \fBsysname\fR
       
   150 .RE
       
   151 .RS +4
       
   152 .TP
       
   153 .ie t \(bu
       
   154 .el o
       
   155 \fBsysservices\fR
       
   156 .RE
       
   157 .RS +4
       
   158 .TP
       
   159 .ie t \(bu
       
   160 .el o
       
   161 \fBagentgroup\fR
       
   162 .RE
       
   163 .RS +4
       
   164 .TP
       
   165 .ie t \(bu
       
   166 .el o
       
   167 \fBagentuser\fR
       
   168 .RE
       
   169 .RS +4
       
   170 .TP
       
   171 .ie t \(bu
       
   172 .el o
       
   173 \fBauthtrapenable\fR
       
   174 .RE
       
   175 .SH OPTIONS
       
   176 .sp
       
   177 .LP
       
   178 The following options are supported:
       
   179 .sp
       
   180 .ne 2
       
   181 .mk
       
   182 .na
       
   183 \fB\fB-?\fR\fR
       
   184 .ad
       
   185 .br
       
   186 .na
       
   187 \fB\fB-\fR\fB-help\fR\fR
       
   188 .ad
       
   189 .sp .6
       
   190 .RS 4n
       
   191 Displays usage information.
       
   192 .RE
       
   193 
       
   194 .sp
       
   195 .ne 2
       
   196 .mk
       
   197 .na
       
   198 \fB\fB-c\fR\fR
       
   199 .ad
       
   200 .br
       
   201 .na
       
   202 \fB\fB-\fR\fB-no-community\fR\fR
       
   203 .ad
       
   204 .sp .6
       
   205 .RS 4n
       
   206 Do not transfer v1/v2c communities.
       
   207 .RE
       
   208 
       
   209 .sp
       
   210 .ne 2
       
   211 .mk
       
   212 .na
       
   213 \fB\fB-i\fR\fR
       
   214 .ad
       
   215 .br
       
   216 .na
       
   217 \fB\fB-\fR\fB-ignore-unrecognized-directives\fR\fR
       
   218 .ad
       
   219 .sp .6
       
   220 .RS 4n
       
   221 Continue processing if unrecognized directives are present.
       
   222 .RE
       
   223 
       
   224 .sp
       
   225 .ne 2
       
   226 .mk
       
   227 .na
       
   228 \fB\fB-l\fR \fBagent\fR | \fBmaster\fR\fR
       
   229 .ad
       
   230 .br
       
   231 .na
       
   232 \fB\fB-\fR\fB-master-trap-target\fR=\fBagent\fR | \fBmaster\fR\fR
       
   233 .ad
       
   234 .sp .6
       
   235 .RS 4n
       
   236 If \fBagent\fR is specified, the existing SMA trap targets will be configured to receive traps that were previously sent to destinations for the Sun Fire SNMP agent. If \fBmaster\fR is specified, the targets will be configured to receive Sun Fire SNMP traps, but existing SNMP target parameters will be used.
       
   237 .RE
       
   238 
       
   239 .sp
       
   240 .ne 2
       
   241 .mk
       
   242 .na
       
   243 \fB\fB-m\fR\fR
       
   244 .ad
       
   245 .br
       
   246 .na
       
   247 \fB\fB-\fR\fB-no-usmuser\fR\fR
       
   248 .ad
       
   249 .sp .6
       
   250 .RS 4n
       
   251 Do not transfer usm (v3) users.
       
   252 .RE
       
   253 
       
   254 .sp
       
   255 .ne 2
       
   256 .mk
       
   257 .na
       
   258 \fB\fB-n\fR\fR
       
   259 .ad
       
   260 .br
       
   261 .na
       
   262 \fB\fB-\fR\fB-dry-run\fR\fR
       
   263 .ad
       
   264 .sp .6
       
   265 .RS 4n
       
   266 Run the migration without modifying any files. If an error arises, continue processing. This can be used to determine the likely migration issues.
       
   267 .RE
       
   268 
       
   269 .sp
       
   270 .ne 2
       
   271 .mk
       
   272 .na
       
   273 \fB\fB-p\fR \fBenable\fR | \fBdisable\fR | \fBerror\fR\fR
       
   274 .ad
       
   275 .br
       
   276 .na
       
   277 \fB\fB-\fR\fB-use-agent-port\fR=\fBenable\fR | \fBdisable\fR | \fBerror\fR\fR
       
   278 .ad
       
   279 .sp .6
       
   280 .RS 4n
       
   281 Indicates whether the port originally used by the Sun Fire SNMP agent should be used by the SMA agent after migration (if the two agents are using different ports). If \fBenable\fR is specified, then the port used by the Sun Fire SNMP agent will also be used by the SMA agent after migration. If \fBdisable\fR is specified, the ports used by SMA will not be updated by the migration tool. If the \fBerror\fR option is specified and the SMA agent is not already using the same ports as those used by the original Sun Fire SNMP agent, an error is reported and the migration process is terminated. If no option is specified the default behavior is equivalent to the \fBerror\fR flag.
       
   282 .RE
       
   283 
       
   284 .sp
       
   285 .ne 2
       
   286 .mk
       
   287 .na
       
   288 \fB\fB-r\fR\fR
       
   289 .ad
       
   290 .br
       
   291 .na
       
   292 \fB\fB-\fR\fB-no-trap\fR\fR
       
   293 .ad
       
   294 .sp .6
       
   295 .RS 4n
       
   296 Do not transfer trap destinations.
       
   297 .RE
       
   298 
       
   299 .sp
       
   300 .ne 2
       
   301 .mk
       
   302 .na
       
   303 \fB\fB-s\fR\fR
       
   304 .ad
       
   305 .br
       
   306 .na
       
   307 \fB\fB-\fR\fB-skip-user\fR\fR
       
   308 .ad
       
   309 .sp .6
       
   310 .RS 4n
       
   311 If a user is found in the MASF configuration file that cannot be created in the new configuration because of a change in the engine ID, then output a message indicating that the user could not be migrated (needs to be manually recreated) and continue processing. If this option is not present, the migration tool will consider such a situation as an error and abort.
       
   312 .RE
       
   313 
       
   314 .sp
       
   315 .ne 2
       
   316 .mk
       
   317 .na
       
   318 \fB\fB-t\fR \fBnone\fR | \fBadd\fR\fR
       
   319 .ad
       
   320 .br
       
   321 .na
       
   322 \fB\fB-\fR\fB-trap-filter\fR=\fBnone\fR | \fBadd\fR\fR
       
   323 .ad
       
   324 .sp .6
       
   325 .RS 4n
       
   326 If \fBnone\fR is specified then the script will copy trap directives directly. The administrator might need to manually update the configuration file to ensure traps are only delivered to their intended destinations. If \fBadd\fR is specifed, trap filters will be constructed so that traps originating from the original Sun Fire SNMP agent are delivered only to the destinations that originally received them. The default behavior is \fBadd\fR.
       
   327 .RE
       
   328 
       
   329 .sp
       
   330 .ne 2
       
   331 .mk
       
   332 .na
       
   333 \fB\fB-u\fR \fBagent\fR | \fBmaster\fR | \fBerror\fR\fR
       
   334 .ad
       
   335 .br
       
   336 .na
       
   337 \fB\fB-\fR\fB-select-user\fR=\fBagent\fR | \fBmaster\fR | \fBerror\fR\fR
       
   338 .ad
       
   339 .sp .6
       
   340 .RS 4n
       
   341 Specifies that if a user with the same name is found in both configuration files that the conflict is to be resolved using the specified configuration file as input. Selecting a user from a particular file will also cause the group declaration for that user to be taken from the same file. If \fBagent\fR is specified then the user will be taken from the configuration file for the Sun Fire SNMP Agent. If \fBmaster\fR is specified, the user will be taken from the SMA configuration. Otherwise, if \fBerror\fR is given, the script will terminate. If this option is not present, the default behavior is equivalent to the \fBerror\fR flag.
       
   342 .RE
       
   343 
       
   344 .sp
       
   345 .ne 2
       
   346 .mk
       
   347 .na
       
   348 \fB\fB-V\fR\fR
       
   349 .ad
       
   350 .br
       
   351 .na
       
   352 \fB\fB-\fR\fB-version\fR\fR
       
   353 .ad
       
   354 .sp .6
       
   355 .RS 4n
       
   356 Display the version of this script.
       
   357 .RE
       
   358 
       
   359 .sp
       
   360 .ne 2
       
   361 .mk
       
   362 .na
       
   363 \fB\fB-y\fR \fBagent\fR | \fBmaster\fR | \fBerror\fR\fR
       
   364 .ad
       
   365 .br
       
   366 .na
       
   367 \fB\fB-\fR\fB-select-community\fR=\fBagent\fR | \fBmaster\fR | \fBerror\fR\fR
       
   368 .ad
       
   369 .sp .6
       
   370 .RS 4n
       
   371 Specifies that if a community with the same name is found in both configuration files that the conflict is to be resolved using the specified configuration file as input. If \fBagent\fR is specified then the community will be taken from the configuration file for the Sun Fire SNMP Agent. If \fBmaster\fR is specified, the community will be taken from the SMA configuration. Otherwise, if \fBerror\fR is given, the script will terminate. If this option is not present, the default behavior is equivalent to the \fBerror\fR flag.
       
   372 .RE
       
   373 
       
   374 .SH EXAMPLES
       
   375 .LP
       
   376 \fBExample 1 \fRSimplest Case
       
   377 .sp
       
   378 .LP
       
   379 The command shown below is appropriate for a simple migration. The migration fails if there are any potential conflicts.
       
   380 
       
   381 .sp
       
   382 .in +2
       
   383 .nf
       
   384 # masfcnv
       
   385 .fi
       
   386 .in -2
       
   387 
       
   388 .LP
       
   389 \fBExample 2 \fRMigrating Such That MASF Settings Override
       
   390 .sp
       
   391 .LP
       
   392 To migrate the MASF configuration such that it will always succeed, that MASF settings will override in the event of a conflict with SMA, and that access will still be provided on the original MASF port, enter:
       
   393 
       
   394 .sp
       
   395 .in +2
       
   396 .nf
       
   397 # masfcnv -is -l agent -p enable -u agent -y agent
       
   398 .fi
       
   399 .in -2
       
   400 
       
   401 .LP
       
   402 \fBExample 3 \fRDry Run, Retaining SMA Settings
       
   403 .sp
       
   404 .LP
       
   405 To attempt a dry run and migrate the configuration such that any conflicts will be resolved by retaining existing SMA settings, enter:
       
   406 
       
   407 .sp
       
   408 .in +2
       
   409 .nf
       
   410 masfcnv -l master -u master -y master
       
   411 .fi
       
   412 .in -2
       
   413 
       
   414 .SH EXIT STATUS
       
   415 .sp
       
   416 .ne 2
       
   417 .mk
       
   418 .na
       
   419 \fB\fB0\fR\fR
       
   420 .ad
       
   421 .RS 12n
       
   422 .rt  
       
   423 Success.
       
   424 .RE
       
   425 
       
   426 .sp
       
   427 .ne 2
       
   428 .mk
       
   429 .na
       
   430 \fB\fBnon-zero\fR\fR
       
   431 .ad
       
   432 .RS 12n
       
   433 .rt  
       
   434 A problem occurred during migration.
       
   435 .RE
       
   436 
       
   437 .SH FILES
       
   438 .sp
       
   439 .ne 2
       
   440 .mk
       
   441 .na
       
   442 \fB\fB/etc/sma/snmp/snmpd.conf\fR\fR
       
   443 .ad
       
   444 .br
       
   445 .na
       
   446 \fB\fB/var/sma_snmp/snmpd.conf\fR\fR
       
   447 .ad
       
   448 .sp .6
       
   449 .RS 4n
       
   450 SMA configuration files
       
   451 .RE
       
   452 
       
   453 .sp
       
   454 .ne 2
       
   455 .mk
       
   456 .na
       
   457 \fB\fB/etc/opt/SUNWmasf/conf/snmpd.conf\fR\fR
       
   458 .ad
       
   459 .br
       
   460 .na
       
   461 \fB\fB/var/opt/SUNWmasf/snmpd.dat\fR\fR
       
   462 .ad
       
   463 .sp .6
       
   464 .RS 4n
       
   465 MASF configuration files
       
   466 .RE
       
   467 
       
   468 .sp
       
   469 .ne 2
       
   470 .mk
       
   471 .na
       
   472 \fB\fB/tmp/sma_migration.log\fR\fR
       
   473 .ad
       
   474 .sp .6
       
   475 .RS 4n
       
   476 \fBmasfcnv\fR log file
       
   477 .RE
       
   478 
       
   479 .SH ATTRIBUTES
       
   480 .sp
       
   481 .LP
       
   482 See \fBattributes\fR(5) for descriptions of the following attributes:
       
   483 .sp
       
   484 
       
   485 .sp
       
   486 .TS
       
   487 tab() box;
       
   488 cw(2.75i) |cw(2.75i) 
       
   489 lw(2.75i) |lw(2.75i) 
       
   490 .
       
   491 ATTRIBUTE TYPEATTRIBUTE VALUE
       
   492 _
       
   493 Availabilitysystem/management/snmp/net-snmp/documentation
       
   494 _
       
   495 Interface StabilityVolatile
       
   496 .TE
       
   497 
       
   498 .SH SEE ALSO
       
   499 .sp
       
   500 .LP
       
   501 \fBattributes\fR(5)
       
   502 .SH NOTES
       
   503 .sp
       
   504 .LP
       
   505 The former path to this utility, \fB/usr/sfw/lib\fR, is now a link to \fB/usr/lib\fR.