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
M
monitoring
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
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Pika
monitoring
Commits
aba5e9af
Commit
aba5e9af
authored
Feb 26, 2020
by
fwinkler
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added new script for logging.
parent
ca0dfdf3
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
45 additions
and
0 deletions
+45
-0
daemon/logrotate/pika_collect_errors.sh
daemon/logrotate/pika_collect_errors.sh
+35
-0
daemon/logrotate/pika_mail_error_info.sh
daemon/logrotate/pika_mail_error_info.sh
+10
-0
No files found.
daemon/logrotate/pika_collect_errors.sh
0 → 100755
View file @
aba5e9af
#!/bin/bash
source
/sw/taurus/tools/pika/pika.conf
HOSTNAME
=
`
echo
$(
hostname
)
|
cut
-d
"."
-f
1
`
ERROR_FILE
=
${
PIKA_LOGPATH
}
/
$HOSTNAME
ERROR_COLLECTION_PATH
=
/sw/taurus/tools/pika/logs/
$(
date
+
"%d-%m-%Y"
)
touch
$ERROR_FILE
# grep for various errors in logfile
echo
"search for errors in collectd log file:"
cat
$COLLECTD_LOGFILE
|
grep
-i
"error"
>>
$ERROR_FILE
# search for error in debug output (only for files not older than 1 day)
files
=
"
$(
find /tmp/pika_debug/pika_
*
-mtime
-1
)
"
if
[
!
-z
"
$files
"
]
;
then
echo
"search for errors in debug output:"
for
file
in
"
$files
"
do
grep
-i
"error "
$file
>>
$ERROR_FILE
done
fi
#check size of mail file
FILESIZE
=
$(
stat
-c
%s
"
$ERROR_FILE
"
)
#echo "size: $FILESIZE"
# copy file if size is greater than 0
if
[
$FILESIZE
-gt
0
]
;
then
mkdir
-p
${
ERROR_COLLECTION_PATH
}
cp
$ERROR_FILE
${
ERROR_COLLECTION_PATH
}
fi
rm
$ERROR_FILE
daemon/logrotate/pika_mail_error_info.sh
0 → 100755
View file @
aba5e9af
#!/bin/bash
ERROR_COLLECTION_PATH
=
/sw/taurus/tools/pika/logs/
$(
date
+
"%d-%m-%Y"
)
SUBJECT
=
"[PIKA] found erros"
# send email log exists
if
[
-d
"
$ERROR_COLLECTION_PATH
"
]
;
then
mail
-S
smtp
=
mailin5.zih.tu-dresden.de
-s
"
$SUBJECT
"
-r
$HOSTNAME
@taurus.hrsk.tu-dresden.de frank.winkler@tu-dresden.de
<<<
$ERROR_COLLECTION_PATH
mail
-S
smtp
=
mailin5.zih.tu-dresden.de
-s
"
$SUBJECT
"
-r
$HOSTNAME
@taurus.hrsk.tu-dresden.de robert.dietrich@tu-dresden.de
<<<
$ERROR_COLLECTION_PATH
fi
\ No newline at end of file
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