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

Keepconf plugins #641

Closed
wants to merge 2 commits into from
Closed

Keepconf plugins #641

wants to merge 2 commits into from

Conversation

rfrail3
Copy link
Contributor

@rfrail3 rfrail3 commented Aug 24, 2015

Adding keepconf munin plugins
keepconf_time-day
keepconf_status-day



if [ "$1" = "autoconf" ]; then
echo yes
Copy link
Member

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.

Copy link
Collaborator

@sumpfralle sumpfralle left a 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
Copy link
Collaborator

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'
Copy link
Collaborator

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'`
Copy link
Collaborator

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 '"'`
Copy link
Collaborator

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
Copy link
Collaborator

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".

@sumpfralle
Copy link
Collaborator

@rfrail3: what do you think?

@rfrail3
Copy link
Contributor Author

rfrail3 commented Jan 5, 2017

Hello sumpfralle, Due the time passed, I prefer to close the pull-request, it will have a different approach in a few time. Thanks

@rfrail3 rfrail3 closed this Jan 5, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

3 participants