Skip to content

Instantly share code, notes, and snippets.

@froop
Last active January 20, 2022 21:50
Show Gist options
  • Save froop/73dc422eb78e6079aa99d59be2757897 to your computer and use it in GitHub Desktop.
Save froop/73dc422eb78e6079aa99d59be2757897 to your computer and use it in GitHub Desktop.
[Python] snmptrap負荷テスト
import subprocess
import time
import datetime
for i in range(10000):
time.sleep(0.01)
command = 'snmptrap -v 2c -c public 172.31.1.11 "" netSnmpExperimental netSnmpExperimental.1 s "%08d" netSnmpExperimental.2 s "%s"' % (i, datetime.datetime.now().time())
subprocess.check_call(command, shell=True)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment