def manage_addHttpSLAS(self, newId, rttIndex, deviceIp, community, rttMonEchoAdminURL, rttMonScheduleAdminRttStartTime=1, rttMonCtrlAdminFrequency=60, rttMonCtrlAdminOwner="zenoss", rttMonCtrlAdminThreshold=5000, rttMonCtrlAdminTimeout=5, REQUEST=None): """Add a SLA to this SLA host""" tag = str(newId) cmd=""" snmpset -v2c -c """ + community + """ """ + deviceIp + """ \ .1.3.6.1.4.1.9.9.42.1.2.1.1.4.""" + str(rttIndex) + """ i 7 \ .1.3.6.1.4.1.9.9.42.1.2.1.1.3.""" + str(rttIndex) + """ s '""" + newId + """' \ .1.3.6.1.4.1.9.9.42.1.2.1.1.2.""" + str(rttIndex) + """ s '""" + rttMonCtrlAdminOwner + """' \ .1.3.6.1.4.1.9.9.42.1.2.1.1.5.""" + str(rttIndex) + """ i """ + str(rttMonCtrlAdminThreshold) + """ \ .1.3.6.1.4.1.9.9.42.1.2.1.1.6.""" + str(rttIndex) + """ i """ + str(rttMonCtrlAdminFrequency) + """ \ .1.3.6.1.4.1.9.9.42.1.2.1.1.7.""" + str(rttIndex) + """ i """ + str(rttMonCtrlAdminTimeout) + """ \ .1.3.6.1.4.1.9.9.42.1.2.2.1.1.""" + str(rttIndex) + """ i 25 \ .1.3.6.1.4.1.9.9.42.1.2.2.1.13.""" + str(rttIndex) + """ i 2 \ .1.3.6.1.4.1.9.9.42.1.2.5.1.2.""" + str(rttIndex) + """ t """ + str(rttMonScheduleAdminRttStartTime) + """ \ .1.3.6.1.4.1.9.9.42.1.2.2.1.15.""" + str(rttIndex) + """ s '""" + rttMonEchoAdminURL + """' \ .1.3.6.1.4.1.9.9.42.1.2.2.1.20.""" + str(rttIndex) + """ s 'GET / HTTP/1.0\r\n' \ .1.3.6.1.4.1.9.9.42.1.2.1.1.9.""" + str(rttIndex) + """ i 4 """ log.info("SLA Add cmd %s", cmd) newId = "addSLA" + str(rttIndex) Commandable.manage_addUserCommand(self, newId, desc='SLA add command', cmd=cmd) Commandable.manage_doUserCommand(self, newId) Commandable.manage_deleteUserCommand(self, ids=newId) if REQUEST: return self.callZenScreen(REQUEST)
def manage_writeMemSLAS(self, deviceIp, community, REQUEST=None): """Write mem on a host""" cmd=""" snmpset -v2c -c """ + community + """ """ + deviceIp + """ \ .1.3.6.1.4.1.9.2.1.54.0 i 1 """ newId = "writeMemSLA" Commandable.manage_addUserCommand(self, newId, desc='SLA write mem command', cmd=cmd) Commandable.manage_doUserCommand(self, newId) Commandable.manage_deleteUserCommand(self, ids=newId) if REQUEST: return self.callZenScreen(REQUEST)
def manage_delSLAS(self, rttIndex, deviceIp, community, REQUEST=None): """Delete a SLA on a host""" cmd=""" snmpset -v2c -c """ + community + """ """ + deviceIp + """ \ .1.3.6.1.4.1.9.9.42.1.2.1.1.9.""" + str(rttIndex) + """ i 6 """ newId = "delSLA" + str(rttIndex) Commandable.manage_addUserCommand(self, newId, desc='SLA delete command', cmd=cmd) Commandable.manage_doUserCommand(self, newId) Commandable.manage_deleteUserCommand(self, ids=newId) if REQUEST: return self.callZenScreen(REQUEST)
def manage_addDhcpSLAS(self, newId, rttIndex, deviceIp, community, rttMonScheduleAdminRttStartTime=1, rttMonCtrlAdminOwner="zenoss", REQUEST=None): """Add a SLA to this SLA host""" tag = str(newId) cmd=""" snmpset -v2c -c """ + community + """ """ + deviceIp + """ \ .1.3.6.1.4.1.9.9.42.1.2.1.1.4.""" + str(rttIndex) + """ i 11 \ .1.3.6.1.4.1.9.9.42.1.2.1.1.3.""" + str(rttIndex) + """ s '""" + newId + """' \ .1.3.6.1.4.1.9.9.42.1.2.1.1.2.""" + str(rttIndex) + """ s '""" + rttMonCtrlAdminOwner + """' \ .1.3.6.1.4.1.9.9.42.1.2.2.1.1.""" + str(rttIndex) + """ i 29 \ .1.3.6.1.4.1.9.9.42.1.2.2.1.13.""" + str(rttIndex) + """ i 2 \ .1.3.6.1.4.1.9.9.42.1.2.5.1.2.""" + str(rttIndex) + """ t """ + str(rttMonScheduleAdminRttStartTime) + """ \ .1.3.6.1.4.1.9.9.42.1.2.1.1.9.""" + str(rttIndex) + """ i 4 """ log.info("SLA Add cmd %s", cmd) newId = "addSLA" + str(rttIndex) Commandable.manage_addUserCommand(self, newId, desc='SLA add command', cmd=cmd) Commandable.manage_doUserCommand(self, newId) Commandable.manage_deleteUserCommand(self, ids=newId) if REQUEST: return self.callZenScreen(REQUEST)
def manage_addJitterSLAS(self, newId, rttIndex, deviceIp, community, rttMonEchoAdminTargetAddress, rttMonEchoAdminTargetPort, rttMonEchoAdminInterval=60, rttMonEchoAdminNumPackets=100, rttMonScheduleAdminRttStartTime=1, rttMonCtrlAdminOwner="zenoss", REQUEST=None): """Add a SLA to this SLA host""" tag = str(newId) cmd=""" snmpset -v2c -c """ + community + """ """ + deviceIp + """ \ .1.3.6.1.4.1.9.9.42.1.2.1.1.4.""" + str(rttIndex) + """ i 9 \ .1.3.6.1.4.1.9.9.42.1.2.1.1.3.""" + str(rttIndex) + """ s '""" + newId + """' \ .1.3.6.1.4.1.9.9.42.1.2.1.1.2.""" + str(rttIndex) + """ s '""" + rttMonCtrlAdminOwner + """' \ .1.3.6.1.4.1.9.9.42.1.2.2.1.1.""" + str(rttIndex) + """ i 27 \ .1.3.6.1.4.1.9.9.42.1.2.2.1.2.""" + str(rttIndex) + """ x '""" + toHex(rttMonEchoAdminTargetAddress) + """' \ .1.3.6.1.4.1.9.9.42.1.2.2.1.5.""" + str(rttIndex) + """ i """ + str(rttMonEchoAdminTargetPort) + """ \ .1.3.6.1.4.1.9.9.42.1.2.2.1.17.""" + str(rttIndex) + """ i """ + str(rttMonEchoAdminInterval) + """ \ .1.3.6.1.4.1.9.9.42.1.2.2.1.18.""" + str(rttIndex) + """ i """ + str(rttMonEchoAdminNumPackets) + """ \ .1.3.6.1.4.1.9.9.42.1.2.5.1.2.""" + str(rttIndex) + """ t """ + str(rttMonScheduleAdminRttStartTime) + """ \ .1.3.6.1.4.1.9.9.42.1.2.1.1.9.""" + str(rttIndex) + """ i 4 """ log.info("SLA Add cmd %s", cmd) newId = "addSLA" + str(rttIndex) Commandable.manage_addUserCommand(self, newId, desc='SLA add command', cmd=cmd) Commandable.manage_doUserCommand(self, newId) Commandable.manage_deleteUserCommand(self, ids=newId) if REQUEST: return self.callZenScreen(REQUEST)