Adding host using zabcon

After fiddling around for the better part of the day, I finally found the syntax to add a host to zabbix using zabcon.

First, dump the hostgroups in zabbix
hostgroup.get output=extend

+---------------------+-----------------+----------+
| name | groupid | internal |
+---------------------+-----------------+----------+
| Templates | 100100000000001 | 0 |
| Linux servers | 100100000000002 | 0 |
| Windows servers | 100100000000003 | 0 |
| Zabbix servers | 100100000000004 | 0 |
| Discovered hosts | 100100000000005 | 1 |
+---------------------+-----------------+----------+

Then, add the host to the hostgroup using the following syntax.

add host host="example" port="161" useip="1" dns="example.com" ip="192.168.1.1" groups=[{groupid=100100000000001}]

Advertisements

One thought on “Adding host using zabcon

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s