Icon or Button launch Py or Js scripts

We are currently providing monitoring services to several companies, this means a lot of time for each action we want to perform, I am in a process of automation, I have come to automate the deployment and configuration of VMs, updating sites, deployment of folders and hosts …

Now I would like to configure a host and service icon that can run a Python script so I can send a message to teams.
I know this is already integrated in the notifications but, this would give us problems by not having a review before sending the notification, also it is impossible for us because we have no connection on port 6555.

Is this possible or maybe I have gone a little crazy?

Not at all, we do that already
We have a custom icon that (currently) launches a PHP script that do some changes to the hostname and then re-directs the user to our CMDB,

You can place scripts in your web doc folder on the main server and just make a custom action with script.py?argument=$SERVICEDESC$ for example

Looks good!
I have more questions in relation to your answer,

I understand that the argument=X is to set the value of a variable in a function of that script.

the doc path you mention is ~/local/share/doc/check_mk?

how do I point to that path?

I have made a silly script that adds x text to a txt document and it reports that it does not find the path.

image

image

image

image

(Edit)

I have gone into the apache configuration to generate an alias to the aforementioned doc/check_mk path, it redirects me correctly but it is not executing the script.

What am I missing?

So a few things
As the site user

  1. you need to modify apache config in ~/etc/check_mk/apache.conf so it can execute scripts (Options)

  1. In your rule for your action you don’t need an absolut url, an relative will be fine

This one generates an .rdp file so we can connect to windows servers from Checkmk.

  1. Your python example Is not complete, the web server needs to know it’s a Python script, it needs a shebang.

1 Like

During the day yesterday I ended up getting to that same point, but to have you confirm that it is correct makes me happy.

sounds good the RDP connection is a fantastic idea!

thank you very much for your help

best regards

No problem,

We have generally 3 icons:
one for opening a SSH connection, one for RDP and one for opening the host in our CMDB/IPAM

In my case I am performing the following process,
I have created an HTML with JavaScript and a form, the checkmk environment variables I use to fill in the form since in my case the customer satellite site is named with the customer code and this helps the customer service team to generate the ticket, I add a reason field to enter a reason by hand and thus simplify the error message for the HD or systems team, with a submit send that data to a Python script that will send that data by mail to generate the ticket.

When I have it finished I will upload it to this thread in case it is useful.

Hi Mario,

do you have a working solution you could share ?