Skip to content

Instantly share code, notes, and snippets.

@ashleykleynhans
Created March 10, 2020 13:52
Show Gist options
  • Save ashleykleynhans/2261bd129fcb1e1aed2e5085b26def69 to your computer and use it in GitHub Desktop.
Save ashleykleynhans/2261bd129fcb1e1aed2e5085b26def69 to your computer and use it in GitHub Desktop.
Python script to test ClamAV TCP
#!/bin/python
import pyclamd
import sys
try:
cd = pyclamd.ClamdNetworkSocket(host='example.com', port=3310, timeout=5)
if cd.ping():
print("ping succesful")
else:
print("ping failed")
raise Exception('Unable to ping ClamAV Server')
except:
sys.exit(1)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment