How do I call a script multiple times and a part of this script is executed only once?

17 views Asked by At

i have built a ms-teams integration in icinga2, all notifications should end up in a ms-teams channel. My current problem is that I do not want that if on an icinga check several users are deposited, that the message is posted multiple times with the same content but only another user.

I know that icinga calls my script for each user. As an example icinga check "apt" has three users, then icinga would call my script three times with the respective user.

This is not a problem, but instead of submitting it should deposit it in an array and then submit it (for example 3 seconds).

i hope it is clear what i want. here again example.

  1. icinga2 triggers the python app with parameters
  2. app stores the parameters (user) in an array and waits if something else comes < I can't think of anything how to do that.
  3. app sends the message with the userlist and the content to ms-teams < sending is no problem
0

There are 0 answers