Quantcast
Channel: Zammad - Community - Latest posts
Viewing all articles
Browse latest Browse all 6801

CheckMK integration and API object attributes

$
0
0

Infos:

  • Used Zammad version: 6.2.0-1709189301.4a2dd7d0.jammy
  • Used Zammad installation type: package
  • Operating system: ubuntu 22.04
  • Browser + version: Firefox 123.0 (64-bit)

Expected behavior:

Goal is to generate tickets based on CheckMK notifications in dedicated group(s) for specific organization(s), for both services and hosts.

The notification calls the Zammad API according to the CheckMK integration settings and adds attributes like group_id and organization_id, by doing this the ticket is created in the appropriate group for the defined organization and the overviews can be filtered by

  • group is Monitoring group(s)
  • organization is current user organization
  • When the API using curl is called to test the API and ticket object attributes like group_id and organization_id are added, that also organization_id attribute is set in the newly created ticket

Actual behavior:

  • The group is set correctly, the organization is not
    organization_id is not set (nil)
    image

Steps to reproduce the behavior:

Set up Organization(s)
Set up Group(s)
Set up CheckMK integration
Get group_id and organization_id using rails console commands

Test curl API call with defined group_id and organization_id
The group is set correctly, the organization is not

export NOTIFY_HOSTPROBLEMID=123
export NOTIFY_HOSTNAME=SC-154518-01-01
export NOTIFY_HOSTSTATE="DOWN"
export NOTIFY_HOSTOUTPUT="CRITICAL - Host unreachable @ rta nan, lost 100%"


curl -k -X POST \
  -F "event_id=$NOTIFY_HOSTPROBLEMID" \
  -F "host=$NOTIFY_HOSTNAME" \
  -F "state=$NOTIFY_HOSTSTATE" \
  -F "text=$NOTIFY_HOSTOUTPUT" \
  -F "group_id=13" \
  -F "organization_id=8" \
  https://zammad.example.com/api/v1/integration/check_mk/<token> 

Additional notes

Is adding the organization(s) to the customer_id: 1 (System), the correct solution for this issue?

I also tried to set a customer_id=3 which is member of the organization_id=8 but that did not work either.

export NOTIFY_HOSTPROBLEMID=123
export NOTIFY_HOSTNAME=SC-154542-01-01
export NOTIFY_HOSTSTATE="DOWN"
export NOTIFY_HOSTOUTPUT="CRITICAL - Host unreachable @ rta nan, lost 100%"


curl -k -X POST \
  -F "event_id=$NOTIFY_HOSTPROBLEMID" \
  -F "host=$NOTIFY_HOSTNAME" \
  -F "state=$NOTIFY_HOSTSTATE" \
  -F "text=$NOTIFY_HOSTOUTPUT" \
  -F "group_id=13" \
  -F "organization_id=8" \
  -F "customer_id=3" \
  https://zammad.example.com/api/v1/integration/check_mk/<token> 

image

Is it required to add support for organization_id in check_mk_controller.rb or something different?

Any pointer/idea/workaround would be greatly appreciated.

Thanks


Viewing all articles
Browse latest Browse all 6801

Trending Articles