Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Module: Implementation of zabbix_item #1216

Closed
wants to merge 21 commits into from

Conversation

ljvdhooft
Copy link

SUMMARY

This implements a new module, zabbix_item. This module controls the items contained by hosts.

ISSUE TYPE
  • New Module Pull Request
COMPONENT NAME

zabbix_item

ADDITIONAL INFORMATION
- name: Create a new item or rewrite an existing item's info
  community.zabbix.zabbix_item:
    host_name: ExampleHost
    item_name: ExampleItem
    key: ExampleItem
    description: My ExampleItem Description
    type: zabbix_internal
    value_type: text
    status: enabled
    state: present
    tags:
      - tag: ExampleItemTag
        value: ExampleTagValue
      - tag: ExampleItemTag2
        value: ExampleTagValue

@ljvdhooft
Copy link
Author

Regarding Issue #1203 "Request: Implement item module"

@ljvdhooft
Copy link
Author

Hi, not sure why tests failed. Ran them again with a Ansible-docker container closer to the actions runner, all tests passed successfully..

@pyrodie18
Copy link
Collaborator

Looks like they may have just died....restarted

@pyrodie18
Copy link
Collaborator

@ljvdhooft you're getting an error during the test.

2024-04-28T03:56:11.7121231Z TASK [test_zabbix_item : test: change type simple_check] *********************** 2024-04-28T03:56:12.7610134Z �[0;31mfatal: [testhost]: FAILED! => {"changed": false, "msg": "connection error occurred: REST API returned {'code': -32602, 'message': 'Invalid params.', 'data': 'No interface found.'} when sending {\"jsonrpc\": \"2.0\", \"method\": \"item.update\", \"id\": \"d34c2c4d-7ee0-47dc-8e43-5d75d265b13e\", \"params\": {\"itemid\": \"44635\", \"status\": 0, \"name\": \"ExampleItem1\", \"type\": 3, \"delay\": \"10s\", \"authtype\": 0, \"status_codes\": \"200\", \"tags\": [], \"preprocessing\": []}, \"auth\": \"d6b5801300b78af276a9524821568642\"}"}�[0m

@ljvdhooft
Copy link
Author

This probably has to do with some parameters that are not suitable for all item types. This makes testing a bit difficult. The way it is setup right now is that it makes only one item and changes the type of that item until all items were in use. However, by not setting a specific parameter, this remains set in the Zabbix config making it unable to change to another type of item.

I think it would make more sense to make a new item for each type, since that would be the more practical case too. Would tests like this qualify for a PR?

@pyrodie18
Copy link
Collaborator

That is totally ok.

@pyrodie18
Copy link
Collaborator

#1222 is also working on adding this.

@pyrodie18 pyrodie18 closed this May 14, 2024
@ljvdhooft ljvdhooft deleted the zabbix-item branch October 29, 2024 19:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants