better obfuscation for fetch command output
This commit is contained in:
1 parent
bcb1e3094f
commit
6342476312
3 files changed
+22
-1
No files matched your search
@@ -1,3 +1,8 @@
|
|||||||
|
|
||||||
|
# cfg for getting cmd outputs
|
||||||
|
test/unit/fetch_command_output.cfg
|
||||||
|
|
||||||
|
|
||||||
# Byte-compiled / optimized / DLL files
|
# Byte-compiled / optimized / DLL files
|
||||||
__pycache__/
|
__pycache__/
|
||||||
*.py[cod]
|
*.py[cod]
|
||||||
|
|||||||
@@ -106,6 +106,22 @@ NS - not supported - devices do not have support for that feature
|
|||||||
|
|
||||||
To be sure we can support new device we use test files.
|
To be sure we can support new device we use test files.
|
||||||
|
|
||||||
|
### Fetch command output tool
|
||||||
|
There is tool for getting necessary infromatin form running switch
|
||||||
|
```
|
||||||
|
cd test/unit
|
||||||
|
|
||||||
|
# DEVICE_TYPE as PID: in "show inventory" output
|
||||||
|
# INTERFACE an inteface
|
||||||
|
# LLDP_INTERFACE inteface for getting LLDP inforation
|
||||||
|
./fetch_command_output.sh -u USER -p PASSWORD -t DEVICE_TYPE -v s350 \
|
||||||
|
-d SWITCH_IP_or_FQDN -i INTERFACE -l LLDP_INTERFACE
|
||||||
|
```
|
||||||
|
|
||||||
|
Output files from that tool are in "test/unit/command_output/$DEVICE_TYPE"
|
||||||
|
|
||||||
|
### By hand
|
||||||
|
|
||||||
We need text output of those commands, to add new device:
|
We need text output of those commands, to add new device:
|
||||||
```
|
```
|
||||||
show arp
|
show arp
|
||||||
|
|||||||
@@ -146,7 +146,7 @@ do
|
|||||||
|
|
||||||
# skip already fetched command outputs
|
# skip already fetched command outputs
|
||||||
if [ -f "$CMDFILE" -a "$FORCE" = "n" ]; then
|
if [ -f "$CMDFILE" -a "$FORCE" = "n" ]; then
|
||||||
echo "###### Skiping '$CMD'. File '$CMDFILE' exists"
|
echo "###### Skiping '$CMD'. File '$CMDFILE' exists (force run by -f)"
|
||||||
continue
|
continue
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user