Comments (10)
Hmmm that's a good question. The files which should be run seem to be created on my local machine.
There should be no firewall blocking it. From my machine I can connect to the checkmk server, its dashboard and also the agent host. (443 and 22 both are open).
Can I maybe somehow add a code line to debug where it hangs up?
checkmk_agent_server
is the server where checkmk is running on, not the server where the agent is installed, correct?
from ansible-collection-checkmk.general.
Thanks for confirming!
Yes, the release 0.11.0 will hit the galaxy today, and it is already packed, so I will put this fix in the next release.
from ansible-collection-checkmk.general.
The task to register the host runs on the host, that got the agent installed, or on your Ansible controller?
Can you confirm, that there is no firewall preventing communication? Because it looks like there is a dropping firewall in between.
from ansible-collection-checkmk.general.
Also the previous step tribe29.checkmk.agent : Debian Derivates: Install Checkmk CRE Agent.
is running correctly. The agent is installed on the target host.
from ansible-collection-checkmk.general.
This is my current full playbook.yaml
- hosts: default
remote_user: ansible
become: yes
vars:
checkmk_agent_version: "2.1.0p12"
checkmk_agent_edition: cre
checkmk_agent_protocol: https
checkmk_agent_server: checkmk.example.com
checkmk_agent_site: monitoring
checkmk_agent_user: automation
checkmk_agent_secret: '<MY_SECRET>'
checkmk_agent_add_host: 'true'
checkmk_agent_discover: 'true'
checkmk_agent_folder: 'My Folder'
vars_prompt:
- name: "ansible_sudo_pass"
prompt: "[sudo] password for {{ target_user }}"
private: yes
roles:
- tribe29.checkmk.agent
- setup-monitoring
Maybe its related to
- hosts: default
remote_user: ansible
become: yes
from ansible-collection-checkmk.general.
I got something, when I go to /home/my_user.ansible/collections/ansible_collections/tribe29/checkmk/roles/agent/tasks/main.yaml
on my local machine and set become_user: my_user
on all tasks where delegate_to
is set it works!
Although it doesn't find my folder. Maybe because of the space? It's like checkmk_agent_folder: 'My Folder'
Edit:
"msg": "Error calling API. HTTP code 400. Details: b'{\"title\": \"Bad Request\", \"status\": 400, \"detail\": \"These fields have problems: target_folder\", \"fields\": {\"target_folder\": [\"The folder \\'/My Folder\\' could not be found.\"]}}', "
Got it, folder must be my_folder
from ansible-collection-checkmk.general.
I think it is relevant, where you run the registration task. But by default the role will run from the host, where the agent was just installed. So you want to make sure, that that host can talk to the Checkmk server.
from ansible-collection-checkmk.general.
I now got a working solution, it's fixed when explicitly adding become: false
to these both tasks (the ones using delegate_to: localhost
):
https://github.com/tribe29/ansible-collection-tribe29.checkmk/blob/96b0a246970939ba2174b8a9ef8279809f8b6272/roles/agent/tasks/main.yml#L35-L51
https://github.com/tribe29/ansible-collection-tribe29.checkmk/blob/96b0a246970939ba2174b8a9ef8279809f8b6272/roles/agent/tasks/main.yml#L103-L113
It wasn't working because ansible tried to connect with SSH to my local machine with the user ansible
. Because I did set become: yes
and remote_user: ansible
on "global" level of my own playbook.
With the explicit become: false
on the mentioned tasks this global config on my side is ignored.
Maybe this should be added to all places where delegate_to: localhost
is used.
from ansible-collection-checkmk.general.
This is generally fixed by #169.
It might be necessary to double-check one's configuration, but with the added become: false
the role should work out of the box.
from ansible-collection-checkmk.general.
Checked the changes from the PR locally, its working for my case. Thanks!
In my last comment I stated I've added become: false
to tribe29.checkmk.discovery
. In the PR this wasn't changed and indeed, it is not required.
BTW in #169 (comment) you wrote it will be merged for 0.12.0 but the next version would be 0.11.0. Did you mean that?
from ansible-collection-checkmk.general.
Related Issues (20)
- [BUG] "Register Agent for TLS" does not allow for "!" in checkmk_agent_auth on Linux HOT 1
- [FEED] Only register agent if host was created on the server or agent was installed HOT 4
- [FEED] Implement module for LDAP Connections
- [BUG] module "folder" not idempotent HOT 10
- [BUG] `discovery` module out of sync with the Checkmk REST API HOT 2
- [BUG] Error in the Agent role, Firewall seems to be only installed if checkmk_agent_server is an ip address HOT 3
- [FEED] Configure new web services monitoring HOT 1
- [BUG] rule idempotency check does not work for special_agents:vsphere rules HOT 4
- [BUG] ckeckmk agent deployment not respecting variables HOT 1
- [BUG] Unable to register agent for automatic updates HOT 5
- [BUG] Integration tests for downtime module creates downtime in the past HOT 1
- [BUG] Agent role crashes, when connections file absent HOT 4
- [BUG] InvalidAccessKeyId during installing the collection HOT 1
- Agent TLS registration does not work in disributed monitoring
- [BUG] Skip verifying the ssl cert for setting downtimes HOT 1
- [BUG] update_attribute on folder always results in 'changed' HOT 12
- [FEED] Implement module for DCD Connections
- Ansible trying to use linux shell to execute a powershell command HOT 1
- [BUG] Crash using host module on RHEL 7 and SLES 12 (both using Python2) HOT 9
- [BUG] checkmk.general.agent : Fetch fresh monitoring data from host. Fails for agents queried through SSH.
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ansible-collection-checkmk.general.