PDA

View Full Version : zabbix tables


silvana
17-08-2010, 20:28
*Hi,
I am migrating from Nagios to Zabbix, and I would like to migrate the data about the monitored hosts in Nagios, to the Zabbix database.
I know there is an API but it is in draft state , so I prefer not to use this API and instead I would like to insert the data directly into the zabbix database.
So I would like to have more information about zabbix database tables and dependencies
In particular I'd like to know which steps are required in order to create a host in zabbix?
The host have some associated groups and templates, but does not have asociated profiles, extended profiles nor associated macros.

Is it enough to perform the insert operations only in the following tables?
or do I need something else?

1)insert a row into 'hosts' table
2)for each group the host is associated with, insert a row into hosts_group
3)for each template the host is associated with
insert a row into 'hosts_templates' table
for each template item in the 'items' table, insert into the 'items' table the
same item for the host

4)selects and inserts into 'ids' table, in order to get the ids

Thank you for your help!
Silvana

richlv
17-08-2010, 22:03
i would strongly advise against modifying zabbix db directly. it is possible, but can result in inconsistent data that will cause lots of trouble later. instead, i'd suggest one of the following :

1. take a look at the api again - 'draft' should be gone from most of the documentation :)

2. a more time-tested option - create one configuration entity (like host) manually, export it to xml. then script around the xml to create entries for all needed hosts and import that xml back.

in any case, make sure to use zabbix 1.8.3

silvana
18-08-2010, 04:00
Hi, Thank you for your replay!
we are currently using zabbix 1.8.2 with 100 hosts, it seems to work fine.
Now we are migrating the rest of the hosts to zabbix (aprox. 6000 hosts)

I wonder, why do you think that upgrading to zabbix 1.8.3 is necessary?


Best regards.
Silvana

walterheck
18-08-2010, 04:17
1. take a look at the api again - 'draft' should be gone from most of the documentation :)

It's still ultra-limited though..

richlv
18-08-2010, 08:55
I wonder, why do you think that upgrading to zabbix 1.8.3 is necessary?


because it has some important fixes and improvements for xml import and api ;)

It's still ultra-limited though..

anything more specific ?

walterheck
19-08-2010, 03:13
anything more specific ?
Lots of it looks like this:
http://www.zabbix.com/documentation/1.8/api/image/exists

I hardly call that documentation ;)

richlv
19-08-2010, 08:30
Lots of it looks like this:
http://www.zabbix.com/documentation/1.8/api/image/exists

ah, that... hhehe, yeah, that is expected to improve in a very near future :)

silvana
20-08-2010, 20:47
Hi,
I am trying to use the API to create a Host

but I get the following error:
Error -32500: Application error., [ CHost::create ] You do not have enough rights for operation

I perform the operation with a user which is member of the following groups: API access and zabbix administrators

Thanks for your help!

Silvana

walterheck
21-08-2010, 05:58
Hi,
I am trying to use the API to create a Host

but I get the following error:
Error -32500: Application error., [ CHost::create ] You do not have enough rights for operation

I perform the operation with a user which is member of the following groups: API access and zabbix administrators

I don't have the time to search for the thread, but there was someone else just yesterday or the day before that had teh exact same problem, and one of the zabbix devs responded saying it was probably a bug. The thread was about zabcon I think.

silvana
23-08-2010, 16:35
I don't have the time to search for the thread, but there was someone else just yesterday or the day before that had teh exact same problem, and one of the zabbix devs responded saying it was probably a bug. The thread was about zabcon I think.

Thanks so much!
yes I found the thread with the same error, it was about zabcon.