Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

notify-host-mail Doesn't Work (Complains about missing arguments) #725

Open
5 of 8 tasks
ctassell opened this issue Nov 30, 2023 · 1 comment
Open
5 of 8 tasks

notify-host-mail Doesn't Work (Complains about missing arguments) #725

ctassell opened this issue Nov 30, 2023 · 1 comment
Labels
bug Something isn't working

Comments

@ctassell
Copy link

This issue respects the following points:

Which variant of the Monitoring Plugins do you use?

  • .rpm/.deb package from repo.linuxfabrik.ch
  • Compiled for Linux (.tar/.zip from download.linuxfabrik.ch)
  • Compiled for Windows (from download.linuxfabrik.ch)
  • Source Code from GitHub

Bug description

I'm trying to get the notifications working in Icinga2 (2.14) with Director (1.11) on Ubuntu 22.04 Jammy and plugin is reporting that I'm not sending all of the required arguments. This is when using the Linuxfabrik notification templates and the latest packages from the repos. Note that you can't currently install the linuxfabrik-notification-plugins package with apt because it contains some files that overlap with ones in the monitoring-plugins package, so I had to manually unpack it and move the files into the plugins folder.

Steps to reproduce - Plugin call

'/usr/lib64/nagios/plugins/notify-host-mail' '--hostaddress' '10.1.1.1' '--hostaddress6' '' '--hostdisplayname' 'My Box' '--hostname' 'MYBOX01' '--hostoutput' 'PING 10.1.1.1: 5 packets transmitted, 5 received, 0% packet loss, time 806ms. rtt min/avg/max/mdev = 4.344/4.625/4.953/0.229 ms' '--hoststate' 'UP' '--longdatetime' '2023-11-29 23:23:38 -0400' '--mail-port' '25' '--mail-sender' 'nagios@myhost.com' '--mail-server' 'localhost' '--notificationauthorname' 'ctassell' '--notificationcomment' '5th' '--notificationtype' 'CUSTOM' '--perfdata' 'transmitted=5;;;0; received=5;;;0; duplicates=0;;;0; checksum_corrupted=0;;;0; errors=0;;;0; packet_loss=0%;;;0;100 time=806ms;;;0; rtt_min=4.344ms;;;0; rtt_avg=4.625ms;;;0; rtt_max=4.953ms;;;0; rtt_mdev=0.229ms;;;0;' '--shortdatetime' '2023-11-29 23:23:38'

Steps to reproduce - Data

You can run this command from the /usr/lib64/nagios/plugins folder and it will give you the error "notify-host-mail: error: the following arguments are required: --datetime, --host-displayname, --host-state, --mail-recipient" The command is what's coming out of the icinga2.log file when using the LinuxFabrik notification templates.

'/usr/lib64/nagios/plugins/notify-host-mail' '--hostaddress' '10.1.1.1' '--hostaddress6' '' '--hostdisplayname' 'My Box' '--hostname' 'MYBOX01' '--hostoutput' 'PING 10.1.1.1: 5 packets transmitted, 5 received, 0% packet loss, time 806ms. rtt min/avg/max/mdev = 4.344/4.625/4.953/0.229 ms' '--hoststate' 'UP' '--longdatetime' '2023-11-29 23:23:38 -0400' '--mail-port' '25' '--mail-sender' 'nagios@myhost.com' '--mail-server' 'localhost' '--notificationauthorname' 'ctassell' '--notificationcomment' '5th' '--notificationtype' 'CUSTOM' '--perfdata' 'transmitted=5;;;0; received=5;;;0; duplicates=0;;;0; checksum_corrupted=0;;;0; errors=0;;;0; packet_loss=0%;;;0;100 time=806ms;;;0; rtt_min=4.344ms;;;0; rtt_avg=4.625ms;;;0; rtt_max=4.953ms;;;0; rtt_mdev=0.229ms;;;0;' '--shortdatetime' '2023-11-29 23:23:38'

Environment

Ubuntu 22.04 Jammy with the Linuxfabrik PPA deb https://repo.linuxfabrik.ch/monitoring-plugins/ubuntu/ jammy-release main

Plugin Version

v2023051201

Python version

Python 3.10.12

List of Python modules

Modules are fine, command runs, it's just not getting the right args from Icinga

Additional Information

No response

@ctassell ctassell added the bug Something isn't working label Nov 30, 2023
@NavidSassan
Copy link
Member

Hi @ctassell thanks for the issue :) We are aware of the problem when trying to install both the notification and monitoring plugins package, I just opened an issue to track our progress: #726

As for the missing arguments, can you make sure that you are using this version of the template in the director? https://github.com/Linuxfabrik/monitoring-plugins/blob/2023051201/notification-plugins/notify-host-mail/icingaweb2-module-director/notify-host-mail.json

Also, did you set a mail recipient in the notification apply rule?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants