Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
puppet-icinga2_notificationtest
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
testing
puppet-icinga2_notificationtest
Commits
334b777f
Commit
334b777f
authored
Dec 08, 2016
by
Markus Frosch
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Test and fix log-notification.sh
parent
b5698e92
Pipeline
#179
passed with stage
in 32 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
3 deletions
+11
-3
templates/log-notification.sh.erb
templates/log-notification.sh.erb
+11
-3
No files found.
templates/log-notification.sh.erb
View file @
334b777f
...
...
@@ -13,15 +13,23 @@ else
fi
wrap_nl() {
echo $(echo "$1" | sed 's/\n/\n /')
text="$1"
blank="$2"
if [ -z "$blank" ]; then
blank=" "
fi
echo "$(echo "$text" | sed "2~1s/^/$blank/g")"
}
output=$(wrap_nl "$OUTPUT")
if [ -n "$NOTIFICATIONAUTHORNAME" ]; then
output="$output\n Author: $NOTIFICATIONAUTHORNAME\n "$(wrap_nl "$NOTIFICATIONCOMMENT")
output+=`echo -e "\n Author: "`
output+="$NOTIFICATIONAUTHORNAME"
output+=`echo -e "\n Comment: "`
output+=$(wrap_nl "$NOTIFICATIONCOMMENT")
fi
printf "[%s] [%s] [%s] [%s] [%s] %s" \
printf "[%s] [%s] [%s] [%s] [%s] %s
\n
" \
"$DATE" "$USERNAME" "$OBJECT_NAME" "$NOTIFICATIONTYPE" "$STATE" "$output" \
>> "$LOGFILE"
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment