rack awareness
This commit is contained in:
parent
8e40495eb7
commit
acbb767e22
7 changed files with 129 additions and 50 deletions
10
netbox_agent/drivers/cmd.py
Normal file
10
netbox_agent/drivers/cmd.py
Normal file
|
@ -0,0 +1,10 @@
|
|||
import re
|
||||
import subprocess
|
||||
|
||||
|
||||
def get(value, regex):
|
||||
output = subprocess.getoutput(value)
|
||||
r = re.search(regex, output)
|
||||
if r and len(r.groups()) > 0:
|
||||
return r.groups()[0]
|
||||
return None
|
Loading…
Add table
Add a link
Reference in a new issue