Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /opt/noc/sa/profiles/Eaton/SMx5/get_version.py 1582/1582 100%
- # -*- coding: utf-8 -*-
- ##----------------------------------------------------------------------
- ## Eaton.SMx5.get_version
- ##----------------------------------------------------------------------
- ## Copyright (C) 2007-2014 The NOC Project
- ## See LICENSE for details
- ##----------------------------------------------------------------------
- ## Python modules
- import re
- ## NOC modules
- from noc.sa.script import Script as NOCScript
- from noc.sa.interfaces import IGetVersion
- class Script(NOCScript):
- name = "Eaton.SMx5.get_version"
- cache = True
- implements = [IGetVersion]
- def execute(self):
- if self.snmp and self.access_profile.snmp_ro:
- try:
- version = self.snmp.get("1.3.6.1.4.1.1918.2.12.10.20.30.0", cached=True)
- platform = self.snmp.get("1.3.6.1.4.1.1918.2.12.10.10.30.0", cached=True)
- serial = self.snmp.get("1.3.6.1.4.1.1918.2.12.10.10.20.0", cached=True)
- icpver = self.snmp.get("1.3.6.1.4.1.1918.2.12.10.20.50.0", cached=True)
- iobver = self.snmp.get("1.3.6.1.4.1.1918.2.12.10.20.60.0", cached=True)
- return {
- "vendor": "Eaton",
- "platform": platform,
- "version": version,
- "attributes": {
- "Serial": serial,
- "ICP software version": icpver,
- "IOB software version": iobver
- }
- }
- except self.snmp.TimeOutError:
- pass
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement