-
Notifications
You must be signed in to change notification settings - Fork 6
Simplified uptime check #225
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
Conversation
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.
A suggestion about overriding the default values
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 we should have this class take $warning and $critical as parameters, making it possible to override thw defaults?
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.
Sounds like a good idea.
@@ -1,15 +1,17 @@ | |||
# Check uptime | |||
define sunet::nagios::nrpe_check_uptime ( | |||
) { |
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.
String $warning = '30',
String $critical = '50'
} | ||
sunet::nagios::nrpe_command {'check_uptime': | ||
command_line => '/usr/lib/nagios/plugins/check_uptime.pl -f' | ||
command_line => '/usr/lib/nagios/plugins/check_uptime.py' |
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.
command_line => "/usr/lib/nagios/plugins/check_uptime.py -w ${warning} -c ${critical}"
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 add:
String $uptimew = '30',
String $uptimec = '50',
to params
manifests/nagios.pp
Outdated
@@ -90,7 +90,7 @@ | |||
command_line => "/usr/lib/nagios/plugins/check_procs -k -w ${_procw} -c ${_procc}" | |||
} | |||
sunet::nagios::nrpe_command {'check_uptime': | |||
command_line => '/usr/lib/nagios/plugins/check_uptime.pl -f' | |||
command_line => '/usr/lib/nagios/plugins/check_uptime.py' |
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.
and here it would be:
command_line => "/usr/lib/nagios/plugins/check_uptime.py -w ${uptimew} -c ${uptimec}"
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.
Two bug on line 95 in manifests/nagios.pp
You need double quotes around the command and a dollar sign is missing on {uptime}
72cb252
to
08f4a69
Compare
08f4a69
to
9251614
Compare
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.
Looking good!
A simplified uptime check script, with slightly different output. Old one also had a bug and was very hard to read.