add var for range of change
This commit is contained in:
@@ -3,15 +3,17 @@ import os
|
||||
import random
|
||||
import time
|
||||
|
||||
# Read the OID from the environment variable
|
||||
# Read the OID and range from environment variables
|
||||
oid = os.getenv('CUSTOM_OID', '.1.3.6.1.4.1.38446.1.2.4.1.9.1')
|
||||
range_min = int(os.getenv('RANGE_MIN', 0))
|
||||
range_max = int(os.getenv('RANGE_MAX', 6))
|
||||
|
||||
# Initial value
|
||||
value = 1385062
|
||||
|
||||
while True:
|
||||
# Increment the value by a random amount between 0 and 6
|
||||
value += random.randint(0, 6)
|
||||
# Increment the value by a random amount within the specified range
|
||||
value += random.randint(range_min, range_max)
|
||||
|
||||
# Output the value in the required format
|
||||
print(f"{oid} = INTEGER: {value}")
|
||||
|
||||
Reference in New Issue
Block a user