add template generator scripts
This commit is contained in:
parent
c8814d7177
commit
1ece28029c
|
|
@ -1,5 +1,12 @@
|
||||||
Benchmarking and stress testing tool for the Zabbix server
|
Benchmarking and stress testing tool for the Zabbix server
|
||||||
|
|
||||||
|
## Populate data
|
||||||
|
|
||||||
|
Run `./generate-template-metrics.sh > template.xml` and upload template with metrics.
|
||||||
|
Run `./generate-template-clients.sh > clients.xml` and upload template with clients.
|
||||||
|
|
||||||
|
## Run benchmark
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
Usage of zabbix-bench:
|
Usage of zabbix-bench:
|
||||||
-client int
|
-client int
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,71 @@
|
||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
TEMPLATE_NAME="zabbix-bench"
|
||||||
|
GROUP_NAME="Linux servers"
|
||||||
|
CLIENT_PREFIX="client"
|
||||||
|
CLIENTS=200
|
||||||
|
|
||||||
|
echo "<?xml version=\"1.0\" encoding=\"UTF-8\"?>
|
||||||
|
<zabbix_export>
|
||||||
|
<version>3.0</version>
|
||||||
|
<date>2016-11-14T15:56:40Z</date>
|
||||||
|
<groups>
|
||||||
|
<group>
|
||||||
|
<name>${GROUP_NAME}</name>
|
||||||
|
</group>
|
||||||
|
</groups>
|
||||||
|
<hosts>"
|
||||||
|
|
||||||
|
for I in $(seq 1 1 $CLIENTS)
|
||||||
|
do
|
||||||
|
echo "
|
||||||
|
<host>
|
||||||
|
<host>$CLIENT_PREFIX-$I</host>
|
||||||
|
<name>$CLIENT_PREFIX-$I</name>
|
||||||
|
<description/>
|
||||||
|
<proxy/>
|
||||||
|
<status>0</status>
|
||||||
|
<ipmi_authtype>-1</ipmi_authtype>
|
||||||
|
<ipmi_privilege>2</ipmi_privilege>
|
||||||
|
<ipmi_username/>
|
||||||
|
<ipmi_password/>
|
||||||
|
<tls_connect>1</tls_connect>
|
||||||
|
<tls_accept>1</tls_accept>
|
||||||
|
<tls_issuer/>
|
||||||
|
<tls_subject/>
|
||||||
|
<tls_psk_identity/>
|
||||||
|
<tls_psk/>
|
||||||
|
<templates>
|
||||||
|
<template>
|
||||||
|
<name>$TEMPLATE_NAME</name>
|
||||||
|
</template>
|
||||||
|
</templates>
|
||||||
|
<groups>
|
||||||
|
<group>
|
||||||
|
<name>${GROUP_NAME}</name>
|
||||||
|
</group>
|
||||||
|
</groups>
|
||||||
|
<interfaces>
|
||||||
|
<interface>
|
||||||
|
<default>1</default>
|
||||||
|
<type>1</type>
|
||||||
|
<useip>1</useip>
|
||||||
|
<ip>127.0.0.1</ip>
|
||||||
|
<dns/>
|
||||||
|
<port>10050</port>
|
||||||
|
<bulk>1</bulk>
|
||||||
|
<interface_ref>if1</interface_ref>
|
||||||
|
</interface>
|
||||||
|
</interfaces>
|
||||||
|
<applications/>
|
||||||
|
<items/>
|
||||||
|
<discovery_rules/>
|
||||||
|
<macros/>
|
||||||
|
<inventory/>
|
||||||
|
</host>"
|
||||||
|
done
|
||||||
|
|
||||||
|
echo "
|
||||||
|
</hosts>
|
||||||
|
</zabbix_export>
|
||||||
|
"
|
||||||
|
|
@ -0,0 +1,96 @@
|
||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
TEMPLATE_NAME="zabbix-bench"
|
||||||
|
APPLICATION_NAME="zabbix-bench"
|
||||||
|
METRIC_PREFIX="metric"
|
||||||
|
METRICS=200
|
||||||
|
|
||||||
|
echo "<?xml version=\"1.0\" encoding=\"UTF-8\"?>
|
||||||
|
<zabbix_export>
|
||||||
|
<version>3.0</version>
|
||||||
|
<date>2016-11-14T15:57:58Z</date>
|
||||||
|
<groups>
|
||||||
|
<group>
|
||||||
|
<name>Linux servers</name>
|
||||||
|
</group>
|
||||||
|
<group>
|
||||||
|
<name>Templates</name>
|
||||||
|
</group>
|
||||||
|
</groups>
|
||||||
|
<templates>
|
||||||
|
<template>
|
||||||
|
<template>$TEMPLATE_NAME</template>
|
||||||
|
<name>$TEMPLATE_NAME</name>
|
||||||
|
<description/>
|
||||||
|
<groups>
|
||||||
|
<group>
|
||||||
|
<name>Linux servers</name>
|
||||||
|
</group>
|
||||||
|
<group>
|
||||||
|
<name>Templates</name>
|
||||||
|
</group>
|
||||||
|
</groups>
|
||||||
|
<applications>
|
||||||
|
<application>
|
||||||
|
<name>$APPLICATION_NAME</name>
|
||||||
|
</application>
|
||||||
|
</applications>
|
||||||
|
<items>"
|
||||||
|
for I in $(seq 1 1 $METRICS)
|
||||||
|
do
|
||||||
|
echo "
|
||||||
|
<item>
|
||||||
|
<name>$METRIC_PREFIX-$I</name>
|
||||||
|
<type>2</type>
|
||||||
|
<snmp_community/>
|
||||||
|
<multiplier>0</multiplier>
|
||||||
|
<snmp_oid/>
|
||||||
|
<key>$METRIC_PREFIX-$I</key>
|
||||||
|
<delay>0</delay>
|
||||||
|
<history>90</history>
|
||||||
|
<trends>365</trends>
|
||||||
|
<status>0</status>
|
||||||
|
<value_type>3</value_type>
|
||||||
|
<allowed_hosts/>
|
||||||
|
<units/>
|
||||||
|
<delta>0</delta>
|
||||||
|
<snmpv3_contextname/>
|
||||||
|
<snmpv3_securityname/>
|
||||||
|
<snmpv3_securitylevel>0</snmpv3_securitylevel>
|
||||||
|
<snmpv3_authprotocol>0</snmpv3_authprotocol>
|
||||||
|
<snmpv3_authpassphrase/>
|
||||||
|
<snmpv3_privprotocol>0</snmpv3_privprotocol>
|
||||||
|
<snmpv3_privpassphrase/>
|
||||||
|
<formula>1</formula>
|
||||||
|
<delay_flex/>
|
||||||
|
<params/>
|
||||||
|
<ipmi_sensor/>
|
||||||
|
<data_type>0</data_type>
|
||||||
|
<authtype>0</authtype>
|
||||||
|
<username/>
|
||||||
|
<password/>
|
||||||
|
<publickey/>
|
||||||
|
<privatekey/>
|
||||||
|
<port/>
|
||||||
|
<description/>
|
||||||
|
<inventory_link>0</inventory_link>
|
||||||
|
<applications>
|
||||||
|
<application>
|
||||||
|
<name>$APPLICATION_NAME</name>
|
||||||
|
</application>
|
||||||
|
</applications>
|
||||||
|
<valuemap/>
|
||||||
|
<logtimefmt/>
|
||||||
|
</item>"
|
||||||
|
done
|
||||||
|
|
||||||
|
echo "
|
||||||
|
</items>
|
||||||
|
<discovery_rules/>
|
||||||
|
<macros/>
|
||||||
|
<templates/>
|
||||||
|
<screens/>
|
||||||
|
</template>
|
||||||
|
</templates>
|
||||||
|
</zabbix_export>
|
||||||
|
"
|
||||||
Loading…
Reference in New Issue