snmp.page

title "SNMP Settings"
label "SNMP"
help "Configure the SNMP agent settings"

bar "SNMP Settings"

init {
    package require common
}

text {
    display display_page_help
}

field enable {
    label "Enable SNMP"
    type boolean
    default 0
    help {Enable or disable the SNMP agent}
    display display_field_help
}

field community {
    label "Community"
    type text
    default public
    help {The (read-only) SNMP community string}
    display display_field_help
}

field syscontact {
    label "System Contact"
    type text
    default unknown
    help {The value to return for mib-2 sysContact.0}
    display display_field_help
}

field syslocation {
    label "System Location"
    type text
    default unknown
    help {The value to return for mib-2 sysLocation.0}
    display display_field_help
}

button submit {
    label Submit
    stdmode none
    submit {
        if {[cgi save]} {
            # Something was changed
            # start/stop/HUP snmpd as appropriate
            cgi success "SNMP Settings Updated"
        }
    }
}

button edit {
    label Edit
    editmode none
    setmode edit
}

button cancel {
    label Cancel
    stdmode none
}