-
Notifications
You must be signed in to change notification settings - Fork 683
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
Keepconf plugins #641
Keepconf plugins #641
Conversation
|
||
|
||
if [ "$1" = "autoconf" ]; then | ||
echo yes |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"autoconf" must not answer "yes" unconditionally. It must check for the presence of what it is graphing.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Than you for this new plugin!
You submitted it quite a while ago - I hope, you still remember it :)
I added some notes. Please fix at least the whitespace issue - the other notes are just random thoughts.
|
||
for j in ${LIST}; do | ||
if [ ! -f ${j} ]; then | ||
echo no |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe you want to add the reason for "no" here - e.g. "no (file '$j' is missing)"
echo 'graph_args --base 1000 -l 0 ' | ||
echo 'graph_vlabel Hosts' | ||
echo 'graph_scale no' | ||
echo 'graph_category keepconf' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please pick one of the commonly used categories, if one of them matches somehow
|
||
for i in ${LIST}; do | ||
|
||
HNAME=`echo ${i} | md5sum | cut -d - -f1 | sed 's/ //g'` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please check you usage of spaces/tabs (not just in this line)
|
||
HNAME=`echo ${i} | md5sum | cut -d - -f1 | sed 's/ //g'` | ||
|
||
NAME=`cat ${i} | grep ^\"CFG-FILE\" | awk -F, '{print $2}' | tr -d '"'` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what do you think about this?
NAME=$(grep '^"CFG-FILE"' "$i" | awk -F, '{print $2}' | tr -d '"')
I guess, it could be slightly more readable.
Or maybe even use a shell function:
get_config_value() { grep "^\"$2\"" "$1" | awk -F, '{print $2}' | tr -d '"'); }
It could be called like this:
get_config_value "$i" "CFG-FILE"
|
||
=head1 MAGICK MARKERS | ||
|
||
#%# family=auto |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since both plugins share most of their code, it could be a good approach to combine both.
In this case you would add the "suggest" capability returning "status" and "time".
@rfrail3: what do you think? |
Hello sumpfralle, Due the time passed, I prefer to close the pull-request, it will have a different approach in a few time. Thanks |
Adding keepconf munin plugins