ActionHooks and Shellhooks doesnt run

Problem:

I have problem with action hooks and shell hooks. Action hooks didnt register. I created simple bash script:

~ cat /usr/share/foreman/config/hooks/host/managed/(update|destroy|after_destroy)/hook_functions.sh
#!/bin/bash
echo "$(date) >> /tmp/hook.log
exit 0
but hook not runned if i update or destroy host. I see actions in debug-log but there is no mention of actions hook. I havent any idea.

I installed ruby-smart-proxy-shellhooks and i attempt call url:
curl -k -X POST -u admin:PASS -H ‘Content-Type: text/plain’ --data “This is a test” https://domain/shellhooks/print_body

i get it from manual but in have 404 error:

2024-09-20T15:33:53 [I|app|eb3ae283] Started POST “/shellhooks/print_body” for IP at 2024-09-20 15:33:53 +0000
2024-09-20T15:33:53 [F|app|eb3ae283]
eb3ae283 | ActionController::RoutingError (No route matches [POST] “/shellhooks/print_body”):
eb3ae283 |
eb3ae283 | lib/foreman/middleware/logging_context_request.rb:11:in `call’
i restarted foreman with systemd. I noticed that “touch ~foreman/tmp/restart.txt doest” restart server but it also didnt work.

Can anybody help me?
Expected outcome:

Foreman and Proxy versions: 9999-3.12.0-jammy+scratchbuild+20240816182603+ubuntu2204

Foreman and Proxy plugin versions:
ruby-foreman-remote-execution 13.1.0-1
ruby-foreman-webhooks 3.2.3-1
ruby-smart-proxy-shellhooks 0.9.3-1

Distribution and version:
Ubuntu 22.04.4 LTS (jammy)

Hi,
you seem to be mixing the old hooks plugin and shellhooks together.

This would have been honored by the old foreman_hooks plugin. It was replaced with foreman_webhooks. Additionally, even with the old plugin, the hooks couldn’t be triggered by calling the api, the hooks were fired strictly as a reaction to things happening inside foreman.

The scripts for shellhooks should go to /var/lib/foreman-proxy/shellhooks

That’s a start, but it seems that you’re sending this request to your foreman, instead of to the smart proxy. Shellhooks is a smart proxy plugin, so to trigger it manually, you have to send a request to the smart proxy.

Yes, of course. I expected the script to be executed when a host is created, updated or deleted. But foreman doesnt run scripts in hooks/host/managed/update when host updated

Aha. I guessed and sent a request to the proxy port (https://domain:8443/shellhooks/print_body). But I still get 404:

Requested url was not found (< HTTP/1.1 404 Not Found - if curl with -v
)

The documentation and repository describe everything very clearly, but I can’t do it. I looked at the debug logs, but it didn’t clarify anything.

I tried adding addresses to trusted_hosts. I disabled apparrmor. Now I’m trying to modify the code so that at least some information appears.

Maybe I can give some additional information to solve my problem?
Thanks for you answer

PS: My final goal is to send host data to netbox