Implement support for notification types

- add new flag "-t" for notification types to matrix-host-notification
  and matrix-service-notification
- implement value validation for HostState and ServiceState
This commit is contained in:
Jan Dittberner 2024-09-26 17:18:32 +02:00
parent 902d4cb310
commit 1aeacd0d1b
6 changed files with 81 additions and 10 deletions

View file

@ -45,9 +45,10 @@ func parseFlags() *icinga2.HostParameters {
flag.StringVar(&config.LongDateTime, "d", "", "long date time ($icinga.long_date_time$)")
flag.StringVar(&config.Hostname, "l", "", "hostname ($host.name$)")
flag.StringVar(&config.HostDisplayName, "n", "", "host display name ($host.display_name$)")
flag.Var(&config.NotificationType, "t", "notification type ($notification_type$)")
flag.StringVar(&config.HostOutput, "o", "", "host output ($host.output$)")
flag.StringVar(&config.HostState, "s", "", "host state ($host.state$)")
flag.Var(&config.HostState, "s", "host state ($host.state$)")
flag.StringVar(&config.MatrixRoom, "m", "", "matrix room ($notification_matrix_room$)")
flag.Var(&config.MatrixServer, "x", "matrix server ($notification_matrix_server$)")