PDA

View Full Version : zabbix cli frontend


limo
19-04-2006, 18:07
Hello to all,

I see that many suggestions is to tamplating system and changes of many items. I have similar problems and users which uses zabbix arround me too.

I am thinking about implementing of zabbix_cli frontend. Let us find the way how to do changes of many items by command similar to select. Select directly into db is not good because there is no integrity check. But maybe there could be some frontend which could do some work for us..
Maybe like this:

zabbix_cli create {item|trigger|action} params
zabbix_cli delete {item|trigger|action} params
zabbix_cli update {item|trigger|action} params
zabbix_cli cleanup {history|alerts|trends} params
zabbix_cli import {file.xml|image} params
zabbix_cli export {file.xml|image|history|trends}

file.xml could be very simple xml like
<create>
<item>
<param>
<param>
...
</item>
</create>

Sorry I am not xml expert. But today it is very hard to make usable items and templates repository. If we have some xml standard, we can do something better and usefull.

Please tell me what you are thinking about this. I know it is possible to do by bulkloader, but it is very simple now and does not meet all requierements for templates repository.
Basic question is, if this should be native zabbix part or addon developed externaly.

Thank you for answers !
If this could be usefull for somebody, please let me know. I will try to make some basic syntax and put it into wiki.

dotelpenguin
23-03-2009, 17:22
What I would like is a CLI front end that I can extract events and keys from. I would love to be able to say.

#zimbra_cli HOST SHOWTRIGGERS
MAILHOST SMTP DOWN
WEBHOST HTTP DOWN
EVILPENGUIN LASER DOWN
etc

#zimbra_cli mailserver smtp.up.last(0)
12

something like that. If this already exists, please point me in right direction.

Tenzer
24-03-2009, 09:59
The way I see this, is that it either has to be made in PHP, making use of the functions already made for the web frontend, or by using an API which hopefully will be included in a not to distant future.

NOB
24-03-2009, 10:52
The way I see this, is that it either has to be made in PHP, making use of the functions already made for the web frontend, or by using an API which hopefully will be included in a not to distant future.

you are right.
This would be the right way of doing it.

Because we are about to do a migration from a different monitoring
tool, we would need something like:

zbx_cli addhostgroup hostgroup-name
zbx_cli addhost hostgroup-name hostname1 hostname2 hostname3 ...
zbx_cli usetemplate template-name hostname4 hostname5 hostname6 ...

etc.

Regards

Norbert.

dotelpenguin
24-03-2009, 15:41
has anyone already done this? I do not want to reinvent the rocket powered chariot.

nelsonab
24-03-2009, 20:38
I agree this is needed. I have talked with Alexei about an API and he says there is work on this, but I have not heard much more. A while ago I created a basic REST interface for Zabbix. My hope was to extend this interface to also manipulate the configuration. From there you could then write some command line scripts and the full power can then be utilised. However I placed that work on hold waiting for Alexei to release more information on the API.

That was about 2 months ago.

Bottom line. We need this desperately, however doing so now with the Zabbix team working on an API will cause some incompatabilities later as an API is needed for something like this to work.

martin.marcher
25-03-2009, 02:12
Having a Zabbix CLI/API (from a sysadmin point of view I don't care that much, but an API would be nicer - definitely) to create hosts would be a really nice start (also to get data out of it).

I'd even say let me feed data into zabbix over a CLI tool so that I can extract data from arbitrary monitoring source (munin, rrd, $whatever) and feed that to zabbix so that I can keep my historical data...