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

Better way to check required parameters in notification scripts #5812

Closed
B-LUC opened this issue Nov 28, 2017 · 2 comments · Fixed by #6238
Closed

Better way to check required parameters in notification scripts #5812

B-LUC opened this issue Nov 28, 2017 · 2 comments · Fixed by #6238
Assignees
Labels
area/itl Template Library CheckCommands enhancement New feature or request
Milestone

Comments

@B-LUC
Copy link

B-LUC commented Nov 28, 2017

For mail-host-notificatiion.sh:

   for P in HOSTADDRESS LONGDATETIME HOSTNAME HOSTDISPLAYNAME HOSTOUTPUT HOSTSTATE USEREMAIL NOTIFICATIONTYPE
   do
        eval "PAR=\$${P}"
        if [ ! "$PAR" ]
        then
            Error "Parameter '$P' is missing"
        fi
   done

For mail-service-notification.sh:

    for P in HOSTADDRESS LONGDATETIME HOSTNAME HOSTDISPLAYNAME SERVICENAME SERVICEDISPLAYNAME SERVICEOUTPUT SERVICESTATE USEREMAIL NOTIFICATIONTYPE
    do
        eval "PAR=\$${P}"
        if [ ! "$PAR" ]
        then
            Error "Parameter '$P' is missing"
        fi
   done
@mcktr
Copy link
Member

mcktr commented Dec 5, 2017

Since you already looked into the code of the notification scripts, could you provide a pull request? :)

@Crunsher Crunsher added area/itl Template Library CheckCommands enhancement New feature or request labels Dec 13, 2017
@dnsmichi
Copy link
Contributor

dnsmichi commented Apr 5, 2018

@mcktr if you want to dig into this ... otherwise close it. Thanks.

@dnsmichi dnsmichi added the needs feedback We'll only proceed once we hear from you again label Apr 5, 2018
@mcktr mcktr self-assigned this Apr 5, 2018
mcktr added a commit that referenced this issue Apr 18, 2018
This changes the function for checking required parameters in the notification scripts.
This also enhances the error message.

refs #5812
@mcktr mcktr removed the needs feedback We'll only proceed once we hear from you again label Apr 18, 2018
@dnsmichi dnsmichi added this to the 2.9.0 milestone May 3, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/itl Template Library CheckCommands enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants