I am having an issue with getting my python script to return or print any output for the following command run on my fortigate firewall
'diagnose sniffer packet any "host X.X.X.X and port 53" 4 0 a
def dns_pcap():
device = ConnectHandler(device_type="fortinet", ip="X.X.X.X", username="xxxxxxxx", password="xxxxxxxxx")
lines = []
gi_pcap = device.send_command('diagnose sniffer packet GI "host X.X.X>X and port 53" 4 0 a')
output = device.read_channel()
print(output)
dns_pcap()
The script outputs nothing to my terminal, anyone have any idea how to get the output of this to command to print to my screen?
(Also please note I am using python2.7)
I have many scripts running to both fortinet and cisco devices, and they all print outputs from variable assigned commands to screen when i execute my scripts, but not in this case
I am assuming it is because the output is not static like a 'show system interface' but I am not sure how to handle dynamic output from a command.