<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<NCMDeviceTemplate baseTemplateName="Nortel BayStack 460 Series Switch" category="Switch" description="For all Nortel BayStack 460 Series Switches" displayName="Nortel BayStack 460 Series Switch" multiConfigTemplate="false" osType="[NA]" templateName="Nortel_BayStack_460_Series_Switch">
    <RestTemplate name=""/>
    <Vendor displayName="Nortel" vendorName="Nortel">
        <Commands>
            <Command commandstr="show interfaces"/>
            <Command commandstr="show logging"/>
            <Command commandstr="show version"/>
        </Commands>
        <LoggingLevels>
            <Level name="informational" number="0" sequenceid="0"/>
        </LoggingLevels>
    </Vendor>
    <Protocols>
        <Protocol name="SSH/TELNET - TFTP">
            <OperationGroup type="backup">
                <Operation name="Running">
                    <Command commandecho="false" commandstr="c" delay="0" messagesuffix="${LF}" prompt="#" promptactionid="nortelPPActionId" promptecho="true" readfromresponse="false" sequenceid="1" timeout="120000"/>
                    <Command commandecho="false" commandstr="copy running-config tftp address ${UserInput:tftp_server_address} filename ${UserInput:file_name}" delay="0" messagesuffix="${LF}" prompt="#" promptactionid="nortelPPActionId" promptecho="true" readfromresponse="false" sequenceid="2" timeout="120000"/>
                    <Command commandecho="false" commandstr="exit" delay="0" messagesuffix="${LF}" prompt="${UserInput:Prompt}" promptactionid="nortelPPActionId" promptecho="true" readfromresponse="false" sequenceid="3" timeout="20000"/>
                </Operation>
            </OperationGroup>
            <OperationGroup type="upload">
                <Operation name="Running">
                    <Command commandecho="false" commandstr="c" delay="0" messagesuffix="${LF}" prompt="#" promptactionid="nortelPPActionId" promptecho="true" readfromresponse="false" sequenceid="1" timeout="120000"/>
                    <Command commandecho="false" commandstr="configure terminal" delay="0" messagesuffix="${LF}" prompt="#" promptactionid="nortelPPActionId" promptecho="true" readfromresponse="false" sequenceid="2" timeout="120000"/>
                    <Command commandecho="false" commandstr="${UserInput:FileContents}" delay="0" messagesuffix="${LF}" prompt="#" promptactionid="nortelPPActionId" promptecho="true" readfromresponse="false" sequenceid="3" timeout="120000"/>
                    <Command commandecho="false" commandstr="exit" delay="0" messagesuffix="${LF}" prompt="#" promptactionid="nortelPPActionId" promptecho="true" readfromresponse="false" sequenceid="4" timeout="120000"/>
                    <Command commandecho="false" commandstr="exit" delay="0" messagesuffix="${LF}" prompt="${UserInput:Prompt}" promptactionid="nortelPPActionId" promptecho="true" readfromresponse="false" sequenceid="5" timeout="20000"/>
                </Operation>
            </OperationGroup>
        </Protocol>
    </Protocols>
    <NCMPersonality displayName="Nortel BayStack Switch" personalityName="NortelBayStackSwitch">
        <Login enablecommand="" postlogincommand="" postloginprompt="" prelogincommand="CTRL-Y" preloginprompt="Ctrl-Y to begin" suffix="${LF}"/>
        <PersonalityTable>
            <Columns>
                <Column defaultvalue="Not Available" desc="Primary Power" displayname="Power Status" name="POWER_STATUS" sequenceid="3" size="6"/>
            </Columns>
        </PersonalityTable>
        <ConfigurationFile format="Text">
            <ExcludeLines/>
            <SyslogStateCheckers>
                <SyslogState state="enable">
                    <Regex>logging enable</Regex>
                    <Regex>logging remote address $SYSLOG_SERVER_IP$</Regex>
                    <Regex>logging remote level informational</Regex>
                    <Regex>logging remote enable</Regex>
                </SyslogState>
            </SyslogStateCheckers>
        </ConfigurationFile>
        <HardwareDetails>
            <HardwareParser parserFileName="NortelHardwarePropParser.xml">
                <MESSAGE-PARSER>
                    <PARSER CLASSNAME="com.adventnet.util.parser.regex.scalar.RegExScalarParser" TYPE="rule1">
                        <COMMAND NAME="hardware_prop_nortel_baystack_sysinfo">
                            <VALID-RULE>
                                <METADATA>
                                    <SCALAR REFERENCEREQ="false">
                                        <REGEX EXPRESSION="Power Status\s*:\s*(\S+)\s(\S+)" NAME="POWER_STATUS">
                                            <PARAM NAME="POWER_STATUS" TOKENNO="1"/>
                                        </REGEX>
                                        <REGEX EXPRESSION="\s*\S+\s*FW:(\S+).*" NAME="OSVERSION">
                                            <PARAM NAME="OSVERSION" TOKENNO="1"/>
                                        </REGEX>
                                        <REGEX EXPRESSION="\s*(--More--)*sysDescr:\s*BayStack\s*(\S+).*" NAME="MODEL">
                                            <PARAM NAME="MODEL" TOKENNO="2"/>
                                        </REGEX>
                                        <REGEX EXPRESSION="MAC Address\s*:\s*(\S+)" NAME="MACADDRESS">
                                            <PARAM NAME="MACADDRESS" TOKENNO="1"/>
                                        </REGEX>
                                        <REGEX EXPRESSION="\s*Serial\s*#\s*:\s*(\S+)" NAME="SERIALNUMBER">
                                            <PARAM NAME="SERIALNUMBER" TOKENNO="1"/>
                                        </REGEX>
                                    </SCALAR>
                                </METADATA>
                            </VALID-RULE>
                            <ERROR-RULE>
                                <!-- Error rule specific to the command -->
                                <METADATA>
                                    <SCALAR>
                                        <!-- error message for command  -->
                                        <REGEX EXPRESSION=".*(Incomplete command).*" NAME="CmdError1">
                                            <PARAM NAME="ErrorMsg" TOKENNO="0"/>
                                        </REGEX>
                                    </SCALAR>
                                </METADATA>
                            </ERROR-RULE>
                        </COMMAND>
                    </PARSER>
                </MESSAGE-PARSER>
            </HardwareParser>
            <Protocols>
                <Protocol name="">
                    <Commands operation="">
                        <Command commandstr="show sys-info" messagesuffix="${LF}" parsercommandname="hardware_prop_nortel_baystack_sysinfo" prompt="#" promptactionid="nortelPPActionId" responseparserid="nortel_hardware_prop_parser" timeout="120000"/>
                    </Commands>
                    <Commands operation="enterAdvancedMode">
                        <Command commandstr="c" messagesuffix="${LF}" parsercommandname="" prompt="#" promptactionid="nortelPPActionId" responseparserid="nortel_hardware_prop_parser" timeout="120000"/>
                    </Commands>
                    <Commands operation="exitAdvancedMode">
                        <Command commandstr="exit" messagesuffix="${LF}" parsercommandname="" prompt="${UserInput:Prompt}" promptactionid="nortelPPActionId" responseparserid="" timeout="20000"/>
                    </Commands>
                </Protocol>
            </Protocols>
        </HardwareDetails>
    </NCMPersonality>
    <NCMDeviceSysOIDList>
        <NCMDeviceSysOID model="460_24T_PWR" ostype="[NA]" series="BayStack 460" sysoid=".1.3.6.1.4.1.45.3.49.1"/>
    </NCMDeviceSysOIDList>
    <CustDeviceSysOIDList/>
    <PromptActionIds/>
</NCMDeviceTemplate>
