# Copyright 07/09/01 Sun Microsystems, Inc. All Rights Reserved.
# pragma ident "@(#)a5x00-d.rul	1.6 01/07/09 Sun Microsystems"

#
# Rule 400
# Disk_backplane status error Rule
#
proc rpho400 {action ruleId {rowName ""} {rowIndex 0} {matchList ""} } {
        switch $action {
                condition {
                        set value  [ getMyValue $ruleId $rowName ]
                        set nodename [ getExternalRowValue $ruleId sunSmNodeName $rowName ]
                        setRuleParm DYN $ruleId $rowName cur_val $value
                        setRuleParm DYN $ruleId $rowName cur_node $nodename

                        expr { ($value != "OK") && ($value != "noncritical") }
                }
                init {
                        return ""
                }
                open {
                        set value [ getRuleParm DYN $ruleId $rowName cur_val ]
                        set nodename [ getRuleParm DYN $ruleId $rowName cur_node ]
                        set longmsg [ format [ getRuleMsg irpho400longmsg ] "$nodename" "$value" ]
                        set estatus error
                        setRuleText $ruleId $rowName $estatus $longmsg
                        return $estatus
                }
                continue {
                        set value [ getRuleParm DYN $ruleId $rowName cur_val ]
                        set nodename [ getRuleParm DYN $ruleId $rowName cur_node ]
                        set longmsg [ format [ getRuleMsg irpho400longmsg ] "$nodename" "$value" ]
                        set estatus error
                        return $estatus
                }
                ack {
                        return
                }
                fix {
                        return
                }
                close {
                        return ok
                }
        }
}

#
# Rule 401
# Fan_tray error Rule
#
proc rpho401 {action ruleId {rowName ""} {rowIndex 0} {matchList ""} } {
        switch $action {
                condition {
                        ddl print debug " from condition of rpho401: \n"
                        set value  [ getMyValue $ruleId $rowName ]
                        ddl print debug " from condition of rpho401:value is $value\n"
                        set nodename [ getExternalRowValue $ruleId sunSmNodeName $rowName ]
                        setRuleParm DYN $ruleId $rowName cur_val $value
                        setRuleParm DYN $ruleId $rowName cur_node $nodename

                        expr { ($value != "OK") && ($value != "noncritical") }
                }
                init {
                        ddl print debug " from init of rpho401: \n"
                        return ""
                }
                open {
                        ddl print debug " from open of rpho401: \n"
                        set value [ getRuleParm DYN $ruleId $rowName cur_val ]
                        ddl print debug " from open of rpho401:value is $value\n"
                        set nodename [ getRuleParm DYN $ruleId $rowName cur_node ]
                        ddl print debug " from open of rpho401:nodename is $nodename\n"
                        set longmsg [ format [ getRuleMsg irpho401longmsg ] "$nodename" "$value" ]
                        ddl print debug " from open of rpho401:longmsg is $longmsg\n"
                        set estatus error
                        setRuleText $ruleId $rowName $estatus $longmsg
                        return $estatus
                }
                continue {
                        ddl print debug " from continue of rpho401: \n"
                        set value [ getRuleParm DYN $ruleId $rowName cur_val ]
                        ddl print debug " from continue of rpho401:value is $value\n"
                        set nodename [ getRuleParm DYN $ruleId $rowName cur_node ]
                        ddl print debug " from continue of rpho401:nodename is $nodename\n"
                        set longmsg [ format [ getRuleMsg irpho401longmsg ] "$nodename" "$value" ]
                        ddl print debug " from continue of rpho401:longmsg is $longmsg\n"
                        set estatus error
                        return $estatus
                }
                ack {
                        return
                }
                fix {
                        return
                }
                close {
                        return ok
                }
        }
}

#
# Rule 402
# Power supply Rule
#
proc rpho402 {action ruleId {rowName ""} {rowIndex 0} {matchList ""} } {
        switch $action {
                condition {
                        ddl print debug " from condition of rpho402: \n"
                        set value  [ getMyValue $ruleId $rowName ]
                        ddl print debug " from condition of rpho402:value is $value\n"
                        set nodename [ getExternalRowValue $ruleId sunSmNodeName $rowName ]
                        setRuleParm DYN $ruleId $rowName cur_val $value
                        setRuleParm DYN $ruleId $rowName cur_node $nodename

                        expr { ($value != "OK") && ($value != "noncritical") }
                }
                init {
                        ddl print debug " from init of rpho402: \n"
                        return ""
                }
                open {
                        ddl print debug " from open of rpho402: \n"
                        set value [ getRuleParm DYN $ruleId $rowName cur_val ]
                        ddl print debug " from open of rpho402:value is $value\n"
                        set nodename [ getRuleParm DYN $ruleId $rowName cur_node ]
                        ddl print debug " from open of rpho402:nodename is $nodename\n"
                        set longmsg [ format [ getRuleMsg irpho402longmsg ] "$nodename" "$value" ]
                        ddl print debug " from open of rpho402:longmsg is $longmsg\n"
                        set estatus error
                        setRuleText $ruleId $rowName $estatus $longmsg
                        return $estatus
                }
                continue {
                        ddl print debug " from continue of rpho402: \n"
                        set value [ getRuleParm DYN $ruleId $rowName cur_val ]
                        ddl print debug " from continue of rpho402:value is $value\n"
                        set nodename [ getRuleParm DYN $ruleId $rowName cur_node ]
                        ddl print debug " from continue of rpho402:nodename is $nodename\n"
                        set longmsg [ format [ getRuleMsg irpho402longmsg ] "$nodename" "$value" ]
                        ddl print debug " from continue of rpho402:longmsg is $longmsg\n"
                        set estatus error
                        return $estatus
                }
                ack {
                        return
                }
                fix {
                        return
                }
                close {
                        return ok
                }
        }
}

#
# Rule 403
# Gbic Rule
#
proc rpho403 {action ruleId {rowName ""} {rowIndex 0} {matchList ""} } {
        switch $action {
                condition {
                        ddl print debug " from condition of rpho403: \n"
                        set value  [ getMyValue $ruleId $rowName ]
                        ddl print debug " from condition of rpho403:value is $value\n"
                        set nodename [ getExternalRowValue $ruleId sunSmNodeName $rowName ]
                        setRuleParm DYN $ruleId $rowName cur_val $value
                        setRuleParm DYN $ruleId $rowName cur_node $nodename

                        expr { ($value != "OK") && ($value != "noncritical") }
                }
                init {
                        ddl print debug " from init of rpho403: \n"
                        return ""
                }
                open {
                        ddl print debug " from open of rpho403: \n"
                        set value [ getRuleParm DYN $ruleId $rowName cur_val ]
                        ddl print debug " from open of rpho403:value is $value\n"
                        set nodename [ getRuleParm DYN $ruleId $rowName cur_node ]
                        ddl print debug " from open of rpho403:nodename is $nodename\n"
                        set longmsg [ format [ getRuleMsg irpho403longmsg ] "$nodename" "$value" ]
                        ddl print debug " from open of rpho403:longmsg is $longmsg\n"
                        set estatus error
                        setRuleText $ruleId $rowName $estatus $longmsg
                        return $estatus
                }
                continue {
                        ddl print debug " from continue of rpho403: \n"
                        set value [ getRuleParm DYN $ruleId $rowName cur_val ]
                        ddl print debug " from continue of rpho403:value is $value\n"
                        set nodename [ getRuleParm DYN $ruleId $rowName cur_node ]
                        ddl print debug " from continue of rpho403:nodename is $nodename\n"
                        set longmsg [ format [ getRuleMsg irpho403longmsg ] "$nodename" "$value" ]
                        ddl print debug " from continue of rpho403:longmsg is $longmsg\n"
                        set estatus error
                        return $estatus
                }
                ack {
                        return
                }
                fix {
                        return
                }
                close {
                        return ok
                }
        }
}

#
# Rule 404
# Interface_board Rule
#
proc rpho404 {action ruleId {rowName ""} {rowIndex 0} {matchList ""} } {
        switch $action {
                condition {
                        ddl print debug " from condition of rpho404: \n"
                        set value  [ getMyValue $ruleId $rowName ]
                        ddl print debug " from condition of rpho404:value is $value\n"
                        set nodename [ getExternalRowValue $ruleId sunSmNodeName $rowName ]
                        setRuleParm DYN $ruleId $rowName cur_val $value
                        setRuleParm DYN $ruleId $rowName cur_node $nodename

                        expr { ($value != "OK") && ($value != "noncritical") }
                }
                init {
                        ddl print debug " from init of rpho404: \n"
                        return ""
                }
                open {
                        ddl print debug " from open of rpho404: \n"
                        set value [ getRuleParm DYN $ruleId $rowName cur_val ]
                        ddl print debug " from open of rpho404:value is $value\n"
                        set nodename [ getRuleParm DYN $ruleId $rowName cur_node ]
                        ddl print debug " from open of rpho404:nodename is $nodename\n"
                        set longmsg [ format [ getRuleMsg irpho404longmsg ] "$nodename" "$value" ]
                        ddl print debug " from open of rpho404:longmsg is $longmsg\n"
                        set estatus error
                        setRuleText $ruleId $rowName $estatus $longmsg
                        return $estatus
                }
                continue {
                        ddl print debug " from continue of rpho404: \n"
                        set value [ getRuleParm DYN $ruleId $rowName cur_val ]
                        ddl print debug " from continue of rpho404:value is $value\n"
                        set nodename [ getRuleParm DYN $ruleId $rowName cur_node ]
                        ddl print debug " from continue of rpho404:nodename is $nodename\n"
                        set longmsg [ format [ getRuleMsg irpho404longmsg ] "$nodename" "$value" ]
                        ddl print debug " from continue of rpho404:longmsg is $longmsg\n"
                        set estatus error
                        return $estatus
                }
                ack {
                        return
                }
                fix {
                        return
                }
                close {
                        return ok
                }
        }
}

#
# Rule 405
# Interconnect Rule
#
proc rpho405 {action ruleId {rowName ""} {rowIndex 0} {matchList ""} } {
        switch $action {
                condition {
                        ddl print debug " from condition of rpho405: \n"
                        set value  [ getMyValue $ruleId $rowName ]
                        ddl print debug " from condition of rpho405:value is $value\n"
                        set nodename [ getExternalRowValue $ruleId sunSmNodeName $rowName ]
                        setRuleParm DYN $ruleId $rowName cur_val $value
                        setRuleParm DYN $ruleId $rowName cur_node $nodename

                        expr { ($value != "OK") && ($value != "noncritical") }
                }
                init {
                        ddl print debug " from init of rpho405: \n"
                        return ""
                }
                open {
                        ddl print debug " from open of rpho405: \n"
                        set value [ getRuleParm DYN $ruleId $rowName cur_val ]
                        ddl print debug " from open of rpho405:value is $value\n"
                        set nodename [ getRuleParm DYN $ruleId $rowName cur_node ]
                        ddl print debug " from open of rpho405:nodename is $nodename\n"
                        set longmsg [ format [ getRuleMsg irpho405longmsg ] "$nodename" "$value" ]
                        ddl print debug " from open of rpho405:longmsg is $longmsg\n"
                        set estatus error
                        setRuleText $ruleId $rowName $estatus $longmsg
                        return $estatus
                }
                continue {
                        ddl print debug " from continue of rpho405: \n"
                        set value [ getRuleParm DYN $ruleId $rowName cur_val ]
                        ddl print debug " from continue of rpho405:value is $value\n"
                        set nodename [ getRuleParm DYN $ruleId $rowName cur_node ]
                        ddl print debug " from continue of rpho405:nodename is $nodename\n"
                        set longmsg [ format [ getRuleMsg irpho405longmsg ] "$nodename" "$value" ]
                        ddl print debug " from continue of rpho405:longmsg is $longmsg\n"
                        set estatus error
                        return $estatus
                }
                ack {
                        return
                }
                fix {
                        return
                }
                close {
                        return ok
                }
        }
}

#
# Rule 406
# Disk ( ssd ) Rule
#
proc rpho406 {action ruleId {rowName ""} {rowIndex 0} {matchList ""} } {
        switch $action {
                condition {
                        ddl print debug " from condition of rpho406: \n"
                        set value  [ getMyValue $ruleId $rowName ]
                        ddl print debug " from condition of rpho406:value is $value\n"
                        set nodename [ getExternalRowValue $ruleId sunSmNodeName $rowName ]
                        setRuleParm DYN $ruleId $rowName cur_val $value
                        setRuleParm DYN $ruleId $rowName cur_node $nodename

                        expr { ($value != "OK") && ($value != "noncritical") }
                }
                init {
                        ddl print debug " from init of rpho406: \n"
                        return ""
                }
                open {
                        ddl print debug " from open of rpho406: \n"
                        set value [ getRuleParm DYN $ruleId $rowName cur_val ]
                        ddl print debug " from open of rpho406:value is $value\n"
                        set nodename [ getRuleParm DYN $ruleId $rowName cur_node ]
                        ddl print debug " from open of rpho406:nodename is $nodename\n"
                        set longmsg [ format [ getRuleMsg irpho406longmsg ] "$nodename" "$value" ]
                        ddl print debug " from open of rpho406:longmsg is $longmsg\n"
                        set estatus warning
                        setRuleText $ruleId $rowName $estatus $longmsg
                        return $estatus
                }
                continue {
                        ddl print debug " from continue of rpho406: \n"
                        set value [ getRuleParm DYN $ruleId $rowName cur_val ]
                        ddl print debug " from continue of rpho406:value is $value\n"
                        set nodename [ getRuleParm DYN $ruleId $rowName cur_node ]
                        ddl print debug " from continue of rpho406:nodename is $nodename\n"

                        set longmsg [ format [ getRuleMsg irpho406longmsg ] "$nodename" "$value" ]
                        set estatus warning
                        setRuleText $ruleId $rowName $estatus $longmsg
                        return $estatus
                }
        }
}

#
# Rule 407
# Front slot Rule
#
proc rpho407 {action ruleId {rowName ""} {rowIndex 0} {matchList ""} } {
        switch $action {
                condition {
                        ddl print debug " from condition of rpho407: \n"
                        set value  [ getMyValue $ruleId $rowName ]
                        ddl print debug " from condition of rpho407:value is $value\n"
                        set nodename [ getExternalRowValue $ruleId sunSmNodeName $rowName ]
                        setRuleParm DYN $ruleId $rowName cur_val $value
                        setRuleParm DYN $ruleId $rowName cur_node $nodename

                        expr { $value != "OK" }
                }
                init {
                        ddl print debug " from init of rpho407: \n"
                        return ""
                }
                open {
                        ddl print debug " from open of rpho407: \n"
                        set value [ getRuleParm DYN $ruleId $rowName cur_val ]
                        ddl print debug " from open of rpho407:value is $value\n"
                        set nodename [ getRuleParm DYN $ruleId $rowName cur_node ]
                        ddl print debug " from open of rpho407:nodename is $nodename\n"
                        set longmsg [ format [ getRuleMsg irpho407longmsg ] "$nodename" "$value" ]
                        ddl print debug " from open of rpho407:longmsg is $longmsg\n"
			if { [ string first "Warning" $value] > 0 } {
				set estatus warning
                        	setRuleText $ruleId $rowName $estatus $longmsg
                        	return $estatus
			} elseif { [string first "Failure" $value] > 0 } {
                       		set estatus error
                        	setRuleText $ruleId $rowName $estatus $longmsg
                        	return $estatus
			}
			else {
				return ok
			}
                }
                continue {
                        ddl print debug " from continue of rpho407: \n"
                        set value [ getRuleParm DYN $ruleId $rowName cur_val ]
                        ddl print debug " from continue of rpho407:value is $value\n"
                        set nodename [ getRuleParm DYN $ruleId $rowName cur_node ]
                        ddl print debug " from continue of rpho407:nodename is $nodename\n"
                        set longmsg [ format [ getRuleMsg irpho407longmsg ] "$nodename" "$value" ]
                        ddl print debug " from continue of rpho407:longmsg is $longmsg\n"
			if { [ string first "Warning" $value] > 0 } {
				set estatus warning
                        	setRuleText $ruleId $rowName $estatus $longmsg
                        	return $estatus
			} elseif { [string first "Failure" $value] > 0 } {
                       		set estatus error
                        	setRuleText $ruleId $rowName $estatus $longmsg
                        	return $estatus
			} else {
				return ok
			}
                }
                ack {
                        return
                }
                fix {
                        return
                }
                close {
                        return ok
                }
        }
}

#
# Rule 408
# Rear slot Rule
#
proc rpho408 {action ruleId {rowName ""} {rowIndex 0} {matchList ""} } {
        switch $action {
                condition {
                        ddl print debug " from condition of rpho408: \n"
                        set value  [ getMyValue $ruleId $rowName ]
                        ddl print debug " from condition of rpho408:value is $value\n"
                        set nodename [ getExternalRowValue $ruleId sunSmNodeName $rowName ]
                        setRuleParm DYN $ruleId $rowName cur_val $value
                        setRuleParm DYN $ruleId $rowName cur_node $nodename

                        expr { $value != "OK" }
                }
                init {
                        ddl print debug " from init of rpho408: \n"
                        return ""
                }
                open {
                        ddl print debug " from open of rpho408: \n"
                        set value [ getRuleParm DYN $ruleId $rowName cur_val ]
                        ddl print debug " from open of rpho408:value is $value\n"
                        set nodename [ getRuleParm DYN $ruleId $rowName cur_node ]
                        ddl print debug " from open of rpho408:nodename is $nodename\n"
                        set longmsg [ format [ getRuleMsg irpho408longmsg ] "$nodename" "$value" ]
                        ddl print debug " from open of rpho408:longmsg is $longmsg\n"
			if {[ string first "Failure" $value ] > 0 } {
                        	set estatus error
                        	setRuleText $ruleId $rowName $estatus $longmsg
                        	return $estatus
			} elseif { [ string first "Warning" $value ] > 0  } {
                        	set estatus warning
                        	setRuleText $ruleId $rowName $estatus $longmsg
                        	return $estatus
			} else {
				return ok
			}
                }
                continue {
                        ddl print debug " from continue of rpho408: \n"
                        set value [ getRuleParm DYN $ruleId $rowName cur_val ]
                        ddl print debug " from continue of rpho408:value is $value\n"
                        set nodename [ getRuleParm DYN $ruleId $rowName cur_node ]
                        ddl print debug " from continue of rpho408:nodename is $nodename\n"
                        set longmsg [ format [ getRuleMsg irpho408longmsg ] "$nodename" "$value" ]
                        ddl print debug " from continue of rpho408:longmsg is $longmsg\n"
			if {[ string first "Failure" $value ] > 0 } {
                        	set estatus error
                        	setRuleText $ruleId $rowName $estatus $longmsg
                        	return $estatus
			} elseif { [ string first "Warning" $value ] > 0 } {
                        	set estatus warning
                        	setRuleText $ruleId $rowName $estatus $longmsg
                        	return $estatus
			} else {
				return ok
			}
                }
                ack {
                        return
                }
                fix {
                        return
                }
                close {
                        return ok
                }
        }
}

#
# Rule 409
# Power supply temperature Rule
#
proc rpho409 {action ruleId {rowName ""} {rowIndex 0} {matchList ""} } {
        switch $action {
                condition {
                        ddl print debug " from condition of rpho409: \n"
                        set value  [ getMyValue $ruleId $rowName ]
                        ddl print debug " from condition of rpho409:value is $value\n"
                        set nodename [ getExternalRowValue $ruleId sunSmNodeName $rowName ]
                        setRuleParm DYN $ruleId $rowName cur_val $value
                        setRuleParm DYN $ruleId $rowName cur_node $nodename

                        expr { $value != "OK" }
                }
                init {
                        ddl print debug " from init of rpho409: \n"
                        return ""
                }
                open {
                        ddl print debug " from open of rpho409: \n"
                        set value [ getRuleParm DYN $ruleId $rowName cur_val ]
                        ddl print debug " from open of rpho409:value is $value\n"
                        set nodename [ getRuleParm DYN $ruleId $rowName cur_node ]
                        ddl print debug " from open of rpho409:nodename is $nodename\n"
                        set longmsg [ format [ getRuleMsg irpho409longmsg ] "$nodename" "$value" ]
                        ddl print debug " from open of rpho409:longmsg is $longmsg\n"
			if {[ string first "Failure" $value ] > 0 } {
                        	set estatus error
                        	setRuleText $ruleId $rowName $estatus $longmsg
                        	return $estatus
			} elseif { [ string first "Warning" $value ] > 0  } {
                        	set estatus warning
                        	setRuleText $ruleId $rowName $estatus $longmsg
                        	return $estatus
			} else {
				return ok
			}
                }
                continue {
                        ddl print debug " from continue of rpho409: \n"
                        set value [ getRuleParm DYN $ruleId $rowName cur_val ]
                        ddl print debug " from continue of rpho409:value is $value\n"
                        set nodename [ getRuleParm DYN $ruleId $rowName cur_node ]
                        ddl print debug " from continue of rpho409:nodename is $nodename\n"
                        set longmsg [ format [ getRuleMsg irpho409longmsg ] "$nodename" "$value" ]
                        ddl print debug " from continue of rpho409:longmsg is $longmsg\n"
			if {[ string first "Failure" $value ] > 0 } {
                        	set estatus error
                        	setRuleText $ruleId $rowName $estatus $longmsg
                        	return $estatus
			} elseif { [ string first "Warning" $value ] > 0 } {
                        	set estatus warning
                        	setRuleText $ruleId $rowName $estatus $longmsg
                        	return $estatus
			} else {
				return ok
			}
                }
                ack {
                        return
                }
                fix {
                        return
                }
                close {
                        return ok
                }
        }
}

#
# Rule 410
# Interface board temperature Rule
#
proc rpho410 {action ruleId {rowName ""} {rowIndex 0} {matchList ""} } {
        switch $action {
                condition {
                        ddl print debug " from condition of rpho410: \n"
                        set value  [ getMyValue $ruleId $rowName ]
                        ddl print debug " from condition of rpho410:value is $value\n"
                        set nodename [ getExternalRowValue $ruleId sunSmNodeName $rowName ]
                        setRuleParm DYN $ruleId $rowName cur_val $value
                        setRuleParm DYN $ruleId $rowName cur_node $nodename

                        expr { $value != "OK" }
                }
                init {
                        ddl print debug " from init of rpho410: \n"
                        return ""
                }
                open {
                        ddl print debug " from open of rpho410: \n"
                        set value [ getRuleParm DYN $ruleId $rowName cur_val ]
                        ddl print debug " from open of rpho410:value is $value\n"
                        set nodename [ getRuleParm DYN $ruleId $rowName cur_node ]
                        ddl print debug " from open of rpho410:nodename is $nodename\n"
                        set longmsg [ format [ getRuleMsg irpho410longmsg ] "$nodename" "$value" ]
                        ddl print debug " from open of rpho410:longmsg is $longmsg\n"
			if {[ string first "Failure" $value ] > 0 } {
                        	set estatus error
                        	setRuleText $ruleId $rowName $estatus $longmsg
                        	return $estatus
			} elseif { [ string first "Warning" $value ] > 0  } {
                        	set estatus warning
                        	setRuleText $ruleId $rowName $estatus $longmsg
                        	return $estatus
			} else {
				return ok
			}
                }
                continue {
                        ddl print debug " from continue of rpho410: \n"
                        set value [ getRuleParm DYN $ruleId $rowName cur_val ]
                        ddl print debug " from continue of rpho410:value is $value\n"
                        set nodename [ getRuleParm DYN $ruleId $rowName cur_node ]
                        ddl print debug " from continue of rpho410:nodename is $nodename\n"
                        set longmsg [ format [ getRuleMsg irpho410longmsg ] "$nodename" "$value" ]
                        ddl print debug " from continue of rpho410:longmsg is $longmsg\n"
			if {[ string first "Failure" $value ] > 0 } {
                        	set estatus error
                        	setRuleText $ruleId $rowName $estatus $longmsg
                        	return $estatus
			} elseif { [ string first "Warning" $value ] > 0 } {
                        	set estatus warning
                        	setRuleText $ruleId $rowName $estatus $longmsg
                        	return $estatus
			} else {
				return ok
			}
                }
                ack {
                        return
                }
                fix {
                        return
                }
                close {
                        return ok
                }
        }
}

#
# Rule 411
# Front slot loop Rule
#
proc rpho411 {action ruleId {rowName ""} {rowIndex 0} {matchList ""} } {
        switch $action {
                condition {
                        ddl print debug " from condition of rpho411: \n"
                        set value  [ getMyValue $ruleId $rowName ]
                        ddl print debug " from condition of rpho411:value is $value\n"
                        set nodename [ getExternalRowValue $ruleId sunSmNodeName $rowName ]
                        setRuleParm DYN $ruleId $rowName cur_val $value
                        setRuleParm DYN $ruleId $rowName cur_node $nodename

                        expr { ($value != "OK") && ($value != "not installed") }
                }
                init {
                        ddl print debug " from init of rpho411: \n"
                        return ""
                }
                open {
                        ddl print debug " from open of rpho411: \n"
                        set value [ getRuleParm DYN $ruleId $rowName cur_val ]
                        ddl print debug " from open of rpho411:value is $value\n"
                        set nodename [ getRuleParm DYN $ruleId $rowName cur_node ]
                        ddl print debug " from open of rpho411:nodename is $nodename\n"
                        set longmsg [ format [ getRuleMsg irpho411longmsg ] "$nodename" "$value" ]
                        ddl print debug " from open of rpho411:longmsg is $longmsg\n"
			if { $value == "faulted" } {
                       		set estatus error
                       		setRuleText $ruleId $rowName $estatus $longmsg
                       		return $estatus
			} else {
                       		set estatus warning
                       		setRuleText $ruleId $rowName $estatus $longmsg
                       		return $estatus
			}
                }
                continue {
                        ddl print debug " from continue of rpho411: \n"
                        set value [ getRuleParm DYN $ruleId $rowName cur_val ]
                        ddl print debug " from continue of rpho411:value is $value\n"
                        set nodename [ getRuleParm DYN $ruleId $rowName cur_node ]
                        ddl print debug " from continue of rpho411:nodename is $nodename\n"
                        set longmsg [ format [ getRuleMsg irpho411longmsg ] "$nodename" "$value" ]
                        ddl print debug " from continue of rpho411:longmsg is $longmsg\n"
			if { $value == "faulted" } {
                       		set estatus error
                       		setRuleText $ruleId $rowName $estatus $longmsg
                       		return $estatus
			} else {
                       		set estatus warning
                       		setRuleText $ruleId $rowName $estatus $longmsg
                       		return $estatus
			}
                }
                ack {
                        return
                }
                fix {
                        return
                }
                close {
                        return ok
                }
        }
}

#
# Rule 412
# Rear slot loop Rule
#
proc rpho412 {action ruleId {rowName ""} {rowIndex 0} {matchList ""} } {
        switch $action {
                condition {
                        ddl print debug " from condition of rpho412: \n"
                        set value  [ getMyValue $ruleId $rowName ]
                        ddl print debug " from condition of rpho412:value is $value\n"
                        set nodename [ getExternalRowValue $ruleId sunSmNodeName $rowName ]
                        setRuleParm DYN $ruleId $rowName cur_val $value
                        setRuleParm DYN $ruleId $rowName cur_node $nodename

                        expr { ($value != "OK") && ($value != "not installed") }
                }
                init {
                        ddl print debug " from init of rpho412: \n"
                        return ""
                }
                open {
                        ddl print debug " from open of rpho412: \n"
                        set value [ getRuleParm DYN $ruleId $rowName cur_val ]
                        ddl print debug " from open of rpho412:value is $value\n"
                        set nodename [ getRuleParm DYN $ruleId $rowName cur_node ]
                        ddl print debug " from open of rpho412:nodename is $nodename\n"
                        set longmsg [ format [ getRuleMsg irpho412longmsg ] "$nodename" "$value" ]
                        ddl print debug " from open of rpho412:longmsg is $longmsg\n"
			if { $value == "faulted" } {
                       		set estatus error
                       		setRuleText $ruleId $rowName $estatus $longmsg
                       		return $estatus
			} else {
                       		set estatus warning
                       		setRuleText $ruleId $rowName $estatus $longmsg
                       		return $estatus
			}
                }
                continue {
                        ddl print debug " from continue of rpho412: \n"
                        set value [ getRuleParm DYN $ruleId $rowName cur_val ]
                        ddl print debug " from continue of rpho412:value is $value\n"
                        set nodename [ getRuleParm DYN $ruleId $rowName cur_node ]
                        ddl print debug " from continue of rpho412:nodename is $nodename\n"
                        set longmsg [ format [ getRuleMsg irpho412longmsg ] "$nodename" "$value" ]
                        ddl print debug " from continue of rpho412:longmsg is $longmsg\n"
			if { $value == "faulted" } {
                       		set estatus error
                       		setRuleText $ruleId $rowName $estatus $longmsg
                       		return $estatus
			} else {
                       		set estatus warning
                       		setRuleText $ruleId $rowName $estatus $longmsg
                       		return $estatus
			}
                }
                ack {
                        return
                }
                fix {
                        return
                }
                close {
                        return ok
                }
	}
}

#
# Rule 413
# loop card Rule
#
proc rpho413 {action ruleId {rowName ""} {rowIndex 0} {matchList ""} } {
        switch $action {
                condition {
                        ddl print debug " from condition of rpho413: \n"
                        set value  [ getMyValue $ruleId $rowName ]
                        ddl print debug " from condition of rpho413:value is $value\n"
                        set nodename [ getExternalRowValue $ruleId sunSmNodeName $rowName ]
                        setRuleParm DYN $ruleId $rowName cur_val $value
                        setRuleParm DYN $ruleId $rowName cur_node $nodename

                        expr { ($value != "OK") && ($value != "noncritical") }
                }
                init {
                        ddl print debug " from init of rpho413: \n"
                        return ""
                }
                open {
                        ddl print debug " from open of rpho413: \n"
                        set value [ getRuleParm DYN $ruleId $rowName cur_val ]
                        ddl print debug " from open of rpho413:value is $value\n"
                        set nodename [ getRuleParm DYN $ruleId $rowName cur_node ]
                        ddl print debug " from open of rpho413:nodename is $nodename\n"
                        set longmsg [ format [ getRuleMsg irpho413longmsg ] "$nodename" "$value" ]
                        ddl print debug " from open of rpho413:longmsg is $longmsg\n"
                       	set estatus error
                       	setRuleText $ruleId $rowName $estatus $longmsg
                       	return $estatus
                }
                continue {
                        ddl print debug " from continue of rpho413: \n"
                        set value [ getRuleParm DYN $ruleId $rowName cur_val ]
                        ddl print debug " from continue of rpho413:value is $value\n"
                        set nodename [ getRuleParm DYN $ruleId $rowName cur_node ]
                        ddl print debug " from continue of rpho413:nodename is $nodename\n"
                        set longmsg [ format [ getRuleMsg irpho413longmsg ] "$nodename" "$value" ]
                        ddl print debug " from continue of rpho413:longmsg is $longmsg\n"
                       	set estatus warning
                       	setRuleText $ruleId $rowName $estatus $longmsg
                       	return $estatus
                }
                ack {
                        return
                }
                fix {
                        return
                }
                close {
                        return ok
                }
	}
}

#
# Rule 414.
# Fibre channel Rule
#
proc rpho414 {action ruleId {rowName ""} {rowIndex 0} {matchList ""} } {
        set estatus "warning"
        switch $action {
                condition {
                        set value  [ getMyValue $ruleId $rowName ]
                        set nodename [ getExternalRowValue $ruleId sunSmNodeName $rowName ]
                        setRuleParm DYN $ruleId $rowName cur_val $value
                        setRuleParm DYN $ruleId $rowName cur_node $nodename

                        expr { $value == "off" }
                }
                open {
                        set value [ getRuleParm DYN $ruleId $rowName cur_val ]
                        set nodename [ getRuleParm DYN $ruleId $rowName cur_node ]
                        set longmsg [ format [ getRuleMsg irpho414longmsg ] "$nodename" "$value" ]
                        set estatus warning
                        setRuleText $ruleId $rowName $estatus $longmsg
                        return $estatus
                }
                continue {
                        set value [ getRuleParm DYN $ruleId $rowName cur_val ]
                        set nodename [ getRuleParm DYN $ruleId $rowName cur_node ]
                        set longmsg [ format [ getRuleMsg irpho414longmsg ] "$nodename" "$value" ]
                        set estatus warning
                        setRuleText $ruleId $rowName $estatus $longmsg
                        return $estatus
                }
                ack {
                        return
                }
                fix {
                        return
                }
                close {
                        return ok
                }
        }
}

#
# Rule 415.
# Fibre channel CRC Rule
#
proc rpho415 {action ruleId {rowName ""} {rowIndex 0} {matchList ""} } {
        set estatus "warning"
        switch $action {
                condition {
                        return 1
                }
                init {
                        ddl print debug "from init of rpho415\n"
                        logSubscribe $ruleId /var/adm/messages "WARNING:  Fibre Channel CRC Error" $rowName $ruleId
                        return ""
                }
                open {
                        set longmsg [ getRuleMsg irpho415longmsg ] 

                        setRuleText $ruleId $rowName $estatus $longmsg

                        logEvent $ruleId $rowName $estatus
                        return ok
                }
                continue {
                        return
                }
                ack {
                        return
                }
                fix {
                        return
                }
                close {
                        return ok
                }
        }
}

#
# Rule 416
#	check : ASC 0x47 (scsi parity error)
#
proc rpho416 {action ruleId {rowName ""} {rowIndex 0} {matchList ""} } {
        set estatus "warning"
        switch $action {
                condition {
                        return 1
                }
                init {
                        ddl print debug "from init of rpho416\n"
                        logSubscribe $ruleId /var/adm/messages "ASC 0x47 (scsi parity error)" $rowName $ruleId
                        return ""
                }
                open {
                        set longmsg [ getRuleMsg irpho416longmsg ] 

                        setRuleText $ruleId $rowName $estatus $longmsg

                        logEvent $ruleId $rowName $estatus
                        return ok
                }
                continue {
                        return
                }
                ack {
                        return
                }
                fix {
                        return
                }
                close {
                        return ok
                }
	}
}


#
# Rule 417
#	check : drive operation marginal
#
proc rpho417 {action ruleId {rowName ""} {rowIndex 0} {matchList ""} } {
        set estatus "errors"
        switch $action {
                condition {
                        return 1
                }
                init {
                        ddl print debug "from init of rpho417\n"
                        logSubscribe $ruleId /var/adm/messages "drive operation marginal" $rowName $ruleId
                        return ""
                }
                open {
                        set longmsg [ getRuleMsg irpho417longmsg ] 

                        setRuleText $ruleId $rowName $estatus $longmsg

                        logEvent $ruleId $rowName $estatus
                        return ok
                }
                continue {
                        return
                }
                ack {
                        return
                }
                fix {
                        return
                }
                close {
                        return ok
                }
	}
}
 
#
# Rule 418
#	check : failure prediction threshold exceeded(false)
#
proc rpho418 {action ruleId {rowName ""} {rowIndex 0} {matchList ""} } {
        set estatus "error"
        switch $action {
                condition {
                        return 1
                }
                init {
                        logSubscribe $ruleId /var/adm/messages "failure prediction threshold exceeded" $rowName $ruleId
                        return ""
                }
                open {
                        set longmsg [ getRuleMsg irpho418longmsg ] 

                        setRuleText $ruleId $rowName $estatus $longmsg

                        logEvent $ruleId $rowName $estatus
                        return ok
                }
                continue {
                        return
                }
                ack {
                        return
                }
                fix {
                        return
                }
                close {
                        return ok
                }
	}
} 


#
# Rule 419
#	check : INCOMPLETE DMA XFER on sbus
#
proc rpho419 {action ruleId {rowName ""} {rowIndex 0} {matchList ""} } {
        set estatus "warning"
        switch $action {
                condition {
                        return 1
                }
                init {
                        ddl print debug "from init of rpho419\n"
                        logSubscribe $ruleId /var/adm/messages "INCOMPLETE DMA XFER on sbus" $rowName $ruleId
                        return ""
                }
                open {
                        set longmsg [ getRuleMsg irpho419longmsg ] 

                        setRuleText $ruleId $rowName $estatus $longmsg

                        logEvent $ruleId $rowName $estatus
                        return ok
                }
                continue {
                        return
                }
                ack {
                        return
                }
                fix {
                        return
                }
                close {
                        return ok
                }
	}
} 

#
# Rule 420
#	check : Offline Timeout
#
proc rpho420 {action ruleId {rowName ""} {rowIndex 0} {matchList ""} } {
        set estatus "warning"
        switch $action {
                condition {
                        return 1
                }
                init {
                        ddl print debug "from init of rpho420\n"
                        logSubscribe $ruleId /var/adm/messages "Offline Timeout" $rowName $ruleId
                        return ""
                }
                open {
                        set longmsg [ getRuleMsg irpho420longmsg ] 

                        setRuleText $ruleId $rowName $estatus $longmsg

                        logEvent $ruleId $rowName $estatus
                        return ok
                }
                continue {
                        return
                }
                ack {
                        return
                }
                fix {
                        return
                }
                close {
                        return ok
                }
	}
} 

#
# Rule 421
#	check : soc lilp map failed status=0x5
#
proc rpho421 {action ruleId {rowName ""} {rowIndex 0} {matchList ""} } {
        set estatus "warning"
        switch $action {
                condition {
                        return 1
                }
                init {
                        ddl print debug "from init of rpho421\n"
                        logSubscribe $ruleId /var/adm/messages "soc lilp map failed status=0x5" $rowName $ruleId
                        return ""
                }
                open {
                        set longmsg [ getRuleMsg irpho421longmsg ] 

                        setRuleText $ruleId $rowName $estatus $longmsg

                        logEvent $ruleId $rowName $estatus
                        return ok
                }
                continue {
                        return
                }
                ack {
                        return
                }
                fix {
                        return
                }
                close {
                        return ok
                }
	}
}
 
#
# Rule 422
# Storage Enclosure Rule
#
proc rpho422 {action ruleId {rowName ""} {rowIndex 0} {matchList ""} } {
        switch $action {
                condition {
                        ddl print debug " from condition of rpho422: \n"
                        set value  [ getMyValue $ruleId $rowName ]
                        ddl print debug " from condition of rpho422:value is $value\n"
                        set nodename [ getExternalRowValue $ruleId sunSmNodeName $rowName ]
                        setRuleParm DYN $ruleId $rowName cur_val $value
                        setRuleParm DYN $ruleId $rowName cur_node $nodename

                        expr { ($value == "Invalid bit set") && ($value == "critical") }
                }
                init {
                        ddl print debug " from init of rpho422: \n"
                        return ""
                }
                open {
                        ddl print debug " from open of rpho422: \n"
                        set value [ getRuleParm DYN $ruleId $rowName cur_val ]
                        ddl print debug " from open of rpho422:value is $value\n"
                        set nodename [ getRuleParm DYN $ruleId $rowName cur_node ]
                        ddl print debug " from open of rpho422:nodename is $nodename\n"
                        set longmsg [ format [ getRuleMsg irpho422longmsg ] "$nodename" "$value" ]
                        ddl print debug " from open of rpho422:longmsg is $longmsg\n"
                        set estatus error
                        setRuleText $ruleId $rowName $estatus $longmsg
                        return $estatus
                }
                continue {
                        ddl print debug " from continue of rpho422: \n"
                        set value [ getRuleParm DYN $ruleId $rowName cur_val ]
                        ddl print debug " from continue of rpho422:value is $value\n"
                        set nodename [ getRuleParm DYN $ruleId $rowName cur_node ]
                        ddl print debug " from continue of rpho422:nodename is $nodename\n"
                        set longmsg [ format [ getRuleMsg irpho422longmsg ] "$nodename" "$value" ]
                        ddl print debug " from continue of rpho422:longmsg is $longmsg\n"
                        set estatus error
                        return $estatus
                }
                ack {
                        return
                }
                fix {
                        return
                }
                close {
                        return ok
                }
        }
}

#
# Rule 423
#	check : Hotplug add or remove some parts of a5x00
#
proc rpho423 {action ruleId {rowName ""} {rowIndex 0} {matchList ""} } {
        set estatus "info"
        switch $action {
                condition {
                        return 1
                }
                init {
                        ddl print info "from init of rpho423\n"
                        logSubscribe $ruleId /var/adm/messages "unix:(.*)socal(\[0-9\]+): port (\[0-9\]+): Fibre Channel is OFFLINE" $rowName $ruleId
                        return ""
                }
                open {
                        ddl print debug "from open of rpho423\n"
			set socalno [ lindex $matchList 1 ]
			set portno [ lindex $matchList 2 ]
                        set longmsg [ format [ getRuleMsg irpho423longmsg ] "$socalno" "$portno" ]
                        setRuleText $ruleId $rowName $estatus $longmsg

                        logEvent $ruleId $rowName $estatus
                	toe_send [ locate sena.senaTbl.sena-entry.status ] refreshValueAndTrap
                        return $estatus
                }
                continue {
                        return 
                }
                ack {
                        return
                }
                fix {
                        return
                }
                close {
                        return ok
                }
	}
} 
