Advertisement
Izya12

get_capabilities.py

Apr 27th, 2018
258
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.04 KB | None | 0 0
  1. # -*- coding: utf-8 -*-
  2. # ---------------------------------------------------------------------
  3. # Nateks.NetXpert.get_capabilities
  4. # ---------------------------------------------------------------------
  5. # Copyright (C) 2007-2017 The NOC Project
  6. # See LICENSE for details
  7. # ---------------------------------------------------------------------
  8.  
  9. # Python modules
  10. import re
  11. # NOC modules
  12. from noc.sa.profiles.Generic.get_capabilities import Script as BaseScript
  13. from noc.sa.profiles.Generic.get_capabilities import false_on_cli_error
  14.  
  15.  
  16. class Script(BaseScript):
  17.     name = "Nateks.NetXpert.get_capabilities"
  18.  
  19.     rx_lacp_id = re.compile("^\s+(?P<id>\d+)\s+\d+", re.MULTILINE)
  20.  
  21.     @false_on_cli_error
  22.     def has_stp_cli(self):
  23.         """
  24.        Check box has STP enabled
  25.        """
  26.         cmd = self.cli("sh configuration\r\n")
  27.         return "spanning-tree" in cmd
  28.  
  29.     def has_lldp_cli(self):
  30.         """
  31.        Check box has LLDP enabled
  32.        """
  33.         cmd = self.cli("show configuration\r\n")
  34.         return "lldp run" in cmd
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement