Ad Widget

Collapse

Generate multiple alerts from one xml file

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • bascouba
    Junior Member
    • Nov 2018
    • 2

    #1

    Generate multiple alerts from one xml file

    Hello,

    I'm new to zabbix and I find it very useful. I have a vulnerability scanner (OpenVAS) that is running and I would like to generate alerts from a generated xml file that follow this schema
    Code:
    <hosts>
      <host>
        <report>abcd123zyx</report>
        <hostname> siteA.org </hostname>
        <severity> 8 </severity>
      </host>
      <host>
        <report>abcd456zyx</report>
        <hostname> siteB.org </hostname>
        <severity> 7 </severity>
      </host>
    </hosts>
    I've seen the usecases for templates with items/triggers but I'm not sure this is the correct way to do what I want. As the XML file already contains the alerts I would like zabbix to show, I wonder if it was possible for zabbix to just check the file (for exemple everyday) and pops alert for each host that is in the file.

    It doesn't matter if the host concerned by zabbix's alert is my scanner's server if I can just display the hostname in the alert's name.

    I hope I made my problem clear enough.

    Thank you in advance.

    edit: I can also just create a text file with every hostname in each line without noticing the severity like following:
    siteA.org
    siteB.org
    siteC.org
    Last edited by bascouba; 27-11-2018, 11:43.
  • bascouba
    Junior Member
    • Nov 2018
    • 2

    #2
    Hello again,

    so I managed to make a count of the number of hosts that are vulnerables.
    I figured out that I could use the XML XPath field in the preprocessing's section of the item I was just wondering if I can manage to create an alert for every <host>.
    I used hosts/host/hostname hosts/host/report and hosts/host/severity XPaths and I don't know how can I used these values in my trigger's name. I read the doc about {ITEM.VALUE<1-9>} but I don't understand how it works with preprocessed items

    Thank you for reading

    Comment

    Working...