Projet

Général

Profil

Anomalie #1027

ajout d'une alerte zabbix via les imports XML

Ajouté par Loïc Dachary il y a plus de 11 ans. Mis à jour il y a plus de 11 ans.

Statut:
Fermé
Priorité:
Normale
Assigné à:
Catégorie:
Task
Version cible:
Début:
17/11/2012
Echéance:
28/11/2012
% réalisé:

100%

Temps estimé:
Temps passé:
Difficulté:
2 Facile

Description

http://www.zabbix.com/documentation/1.8/manual/xml_export_import

Chaque élément du fichier XML exporté correspond à une fonction d'API qui le documente.

L'import pour un host fonctionne sans écraser les triggers existants.

Il n'y a pas de mise a jour si un trigger a une expression modifiée alors un nouveau est créé et l'ancien reste en place.

Si la priorité d'un trigger est modifiée alors le trigger est mis a jour et non dupliqué.

Historique

#1

Mis à jour par Loïc Dachary il y a plus de 11 ans

  • Statut changé de Nouveau à Fermé
  • % réalisé changé de 0 à 100
  • http://www.zabbix.com/documentation/1.8/manual/xml_export_import
  • export vs_lamp_pavot qui a déjà un historique d'alertes
  • modification de vs_lamp_pavot:system.cpu.load[,avg1].last(0)}>10 en vs_lamp_pavot:system.cpu.load[,avg1].last(0)}>12
  • import vs_lamp_pavot
  • un nouveau trigger est créé avec la nouvelle expression
  • les alertes sont toujours présentes sur l'ancien trigger
  • chaque élément correspond à une fonction d'API qui le documente
    Comment mettre a jour un trigger ?
#2

Mis à jour par Loïc Dachary il y a plus de 11 ans

  • Statut changé de Fermé à En cours de traitement
  • % réalisé changé de 100 à 70
#3

Mis à jour par Loïc Dachary il y a plus de 11 ans

(12:45:25 AM) _aeris_: mais si tu prends munin par exemple, le fait qu'il soit via des fichiers plats, c'est directement intégrable à puppet
(12:45:34 AM) _aeris_: à l'inverse de zabbix, qui demande qu'on dev une api
(12:46:05 AM) dachary: on pourrait regarder l'import de fichiers xml dans zabbix
(12:46:13 AM) dachary: c'est peut etre une bonne alternative a l'api
(12:46:20 AM) dachary: et plus compatible avec puppet
(12:46:21 AM) _aeris_: peut-être
(12:46:25 AM) dachary: bonne idée !
(12:46:34 AM) _aeris_: faut juste pas que ça nous flingue l'histo =)
(12:47:02 AM) dachary: http://www.zabbix.com/documentation/1.8/manual/xml_export_import
(12:47:39 AM) dachary: Exporting and importing network maps is supported since Zabbix version 1.8.2. 
#4

Mis à jour par Loïc Dachary il y a plus de 11 ans

(11:07:02 AM) dachary: Hi, I'm using zabbix-1.8.2 . When I export a trigger, modify it and import again using an XML file, it creates a new trigger instead of updating the original one. Is it supposed to behave this way ? 
(11:10:30 AM) volter: dachary: I think that's normal.
(11:11:02 AM) volter: There's no uniqueness criterion like there is the key for the item.
(11:11:38 AM) volter: Even manually, you can create exactly duplicate triggers.
(11:13:28 AM) dachary: volter: ok :-) How would you suggest using XML import to update a trigger ? 
(11:13:56 AM) ***dachary reading the checkboxes again
(11:14:13 AM) volter: Hm, actually it's a bit different:
(11:14:41 AM) ***dachary listening carefully
(11:14:51 AM) volter: Either the name or the trigger expression must be different, it seems.
(11:14:52 AM) Gertjan_: holding breath actualle...
(11:15:00 AM) volter: Gertjan_: Hey!
(11:15:02 AM) Gertjan_: hey :)
(11:15:12 AM) dachary: volter: the trigger expression is different indeed, the name is the same.
(11:15:13 AM) volter: Are you doing fine?
(11:15:38 AM) volter: So we have clarified that it's valid they both co-exist.
(11:15:58 AM) volter: But how to update that? Hm!
(11:16:10 AM) Gertjan_: not really...been working day and night, and  neighbours across decided to throw a party (dutch schlagers @ 123 dB), and now I'm wasted...but totally without alcohol
(11:16:11 AM) dachary: volter: yes, there does not seem to be a conflict. I guess my question should have been : how do I update the expression of an existing trigger.
(11:16:27 AM) Gertjan_: @problem: perhaps export, delete and then import back again?:S
(11:16:28 AM) volter: Gertjan_: Gosh!
(11:16:46 AM) volter: That's possibly the only approach.
(11:16:49 AM) dachary: Gertjan_: that's a good story :-)
(11:17:05 AM) Gertjan_: dachary: you don't know Dutch Schlagers
(11:17:26 AM) dachary: Gertjan_: but then all the history of the previous trigger will be lost, is that right ? 
(11:17:40 AM) volter: You might loose the events, yes.
(11:17:42 AM) Gertjan_: I guess so, so that's not really a fun thing to do
(11:18:07 AM) smica [~smica@81-0-94-217.pool.invitel.hu] entered the room.
(11:18:14 AM) volter: So you could just delete those triggers you want to update.
(11:18:32 AM) volter: Because the history of a trigger that was different before is rather worthless.
(11:18:50 AM) volter: By the way: Update to a later 1.8!
(11:19:06 AM) Gertjan_: i think this calls for a feature request: add a step to the importing, allowing what to overwrite and what not
(11:19:06 AM) dachary: so the better option would be to use xml import to start from scratch but API calls to update existing triggers. I wonder what the Update existing trigger checkbox in zabbix/import.php relates to then. Probably only to modify the priority or the comment.
(11:19:23 AM) Gertjan_: yes...do some upgrading, your hardware load will thank you !
(11:19:23 AM) dachary: volter: understood
(11:19:52 AM) volter: dachary: Good question indeed!
(11:20:29 AM) volter: And various glitches in the frontend were fixed.
(11:20:49 AM) volter: And some security issues
(11:21:07 AM) dachary: volter: will 2.0.x talk to 1.8.x agents ? Or will I have to upgrade them too ? 
(11:21:09 AM) Gertjan_: upgrade to 1.8.new should only involve replacing server binaries, no DB changes
(11:21:22 AM) Gertjan_: dachary no specific need to update them rightaway
(11:21:42 AM) Gertjan_: you just can't use things in 2.0 the 1.8 agent won't understand
(11:22:38 AM) dachary: I may be able to move to 2.0 on the zabbix server, upgrading on the zabbix agents will be much more tricky. It's good to know the communication will still work :-)
(11:22:44 AM) Gertjan_: im still using som 1.4.x agents with 1.8.x server :)
(11:22:58 AM) Gertjan_: s/som/some
(11:23:08 AM) dachary: excellent Gertjan_ thanks for sharing this good experience, this is very reassuring !
(11:23:32 AM) ***dachary experimenting with upgrading a trigger priority
(11:23:48 AM) volter: dachary: Proxies and nodes must be of the same version.
(11:24:00 AM) Gertjan_: http://www.zabbix.com/documentation/2.0/manual/appendix/compatibility
(11:24:03 AM) volter: That's the only real version constraint.
(11:24:11 AM) Gertjan_: it's about 2.0, but goes for 1.8 as well AFAIK
(11:24:50 AM) volter: Gertjan_: When are you going to move to 2.0?
(11:24:58 AM) Gertjan_: time....time....time
(11:25:04 AM) Gertjan_: it isn't on my side
(11:25:08 AM) volter: Heh!
(11:25:12 AM) Gertjan_: lots of SAP business going on lately
(11:25:26 AM) Gertjan_: which is good because we make more money out of it
(11:25:27 AM) volter: Ah, yes, you mentioned that.
(11:25:34 AM) Gertjan_: but bad for zbx upgrade ;0
(11:25:35 AM) volter: That's something
(11:25:40 AM) volter: And your soul
(11:25:50 AM) Gertjan_: indeed
(11:26:23 AM) Gertjan_: but being a licensed SAP technician I have already sold my soul...welcome to the dark side ;)
(11:26:45 AM) dachary: a bit of context of my ultimate goal : I would like to manage zabbix from puppet and doing so using flat XML file fits the datamodel of puppet. If I was to try the same using the zabbix ruby api and write a puppet module for it, that would be a lot more work. And nobody seems to do that anyway.
(11:27:33 AM) dachary: s/zabbix ruby api/ruby library to access the REST zabbix API/
(11:27:34 AM) zabbix: dachary meant: "a bit of context of my ultimate goal : I would like to manage zabbix from puppet and doing so using flat XML file fits the datamodel of puppet. If I was to try the same using the ruby library to access the REST zabbix API and write a puppet module for it, that would be a lot more work. And nobody seems to do that anyway." 
(11:27:41 AM) dachary: ahaha
(11:27:50 AM) Gertjan_: dachary: what would be the added value of managing this by puppet?
zabbix zabbixor1 
(11:28:07 AM) dachary: this is waaaay cool thanks zabbix !
(11:28:30 AM) Gertjan_: :)
(11:28:48 AM) volter: dachary: The API is not bound to Ruby.
(11:29:13 AM) dachary: Gertjan_: when a host is configured by puppet, it creates the corresponding triggers. From the point of view of the dev it's about saying : run apache on this host and it *implies* monitor it with zabbix. 
(11:29:48 AM) dachary: every service configured via puppet is associated with a zabbix item/trigger
(11:30:37 AM) dachary: does that make sense ? I mean, not having to manually interact with puppet but have the central configuration tool do it instead.
(11:30:45 AM) dachary: s/puppet/zabbix/
(11:30:46 AM) zabbix: dachary meant: "does that make sense ? I mean, not having to manually interact with zabbix but have the central configuration tool do it instead." 
(11:31:05 AM) Gertjan_: I think it does make sense
(11:32:19 AM) dachary: btw, I confirm that changing the priority of a trigger in the XML import does not create a new trigger but updates the existing one. Only by updating the expression or the description does a new trigger get created.
(11:34:17 AM) dachary: that makes me wonder if things are different and more favorable in 2.0
(11:37:17 AM) Gertjan_: dachary: you could just install the latest server binaries and see if something changed for the better in 1.8.15
(11:37:30 AM) Gertjan_: or check with a 2.0 testenvironment
(11:37:55 AM) ***dachary doing this
(11:37:59 AM) dachary: with 2.0
(11:39:04 AM) Gertjan_: updatescripts for the DB in 2.0.4 massively improved, in my case i can now upgrade the DB in under 15 minutes
(11:43:45 AM) volter: dachary: I'm pretty sure it's the same in 2.0.
(11:44:02 AM) volter: Gertjan_: Changing the binaries won't do anything.
(11:44:07 AM) volter: The API works via the frontend.
(11:44:47 AM) volter: At least the same constraints apply in 2.0, if you try to create a duplicate trigger.
(11:45:54 AM) dachary: volter: thanks for the hint, saves me time ;-)
#5

Mis à jour par Loïc Dachary il y a plus de 11 ans

  • % réalisé changé de 70 à 80
#6

Mis à jour par Loïc Dachary il y a plus de 11 ans

(09:08:54 AM) dachary: Hi, I'm looking for puppet support for zabbix, something equivalent to what exists for nagios already (see http://docs.puppetlabs.com/references/latest/type.html#nagioscommand & all). Is there such a thing ? 
(09:10:07 AM) Richlv: dachary, what should it do functionally ?
(09:10:42 AM) dachary: Richlv: feed zabbix so that it monitors the resources being deployed. 
(09:12:51 AM) dachary: it's quite easy to do something simple minded and get results. It's a lot more difficult to get it exactly right, that's why I'm looking for something that already exists instead of hacking something myself ;-)
(09:13:41 AM) Richlv: dachary, bunch of locations have implemented this, not sure how much they have published
(09:14:03 AM) Richlv: bilalcochin, you can grab the data from zabbix. that's about what i know :)
(09:14:35 AM) dachary: Richlv: thanks, I'll keep looking.
#7

Mis à jour par Loïc Dachary il y a plus de 11 ans

  • Statut changé de En cours de traitement à Fermé
  • % réalisé changé de 80 à 100

C'est possible mais pas bien intégré.

Formats disponibles : Atom PDF