#!/bin/bash

host=$1
attempts=$2

for (( attempt=0; attempt<${attempts}; attempt++ )); do
	num=$(($RANDOM % 1000))
	json="{\"data\":["
	dl=""

	for (( i=0; i<${num}; i++ )); do
		json="${json}${dl}{\"{#IF}\": \"eth$i\"}"
		dl=","
	done

	json="${json}]}"

	~/Development/GIT/zabbix-tmp2/bin/zabbix_sender -c ~/Development/GIT/zabbix-tmp2/etc/zabbix_agentd.conf --host "${host}" --key discovery-rule-01 -o "${json}" >/dev/null 2>&1
done
