Skip to content

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

Merged
merged 7 commits into from
Dec 10, 2024
Merged

Simplified uptime check #225

merged 7 commits into from
Dec 10, 2024

Conversation

richir-sunet
Copy link
Contributor

A simplified uptime check script, with slightly different output. Old one also had a bug and was very hard to read.

Copy link
Member

@mickenordin mickenordin left a 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

Copy link
Member

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?

Copy link
Contributor Author

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 (
) {
Copy link
Member

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

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

Copy link
Member

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

@@ -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'
Copy link
Member

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

Copy link
Member

@mickenordin mickenordin left a 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}

@richir-sunet richir-sunet force-pushed the richir_new_check_uptime branch from 72cb252 to 08f4a69 Compare December 10, 2024 13:41
@richir-sunet richir-sunet force-pushed the richir_new_check_uptime branch from 08f4a69 to 9251614 Compare December 10, 2024 13:42
Copy link
Member

@mickenordin mickenordin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking good!

@mickenordin mickenordin merged commit 58e95a8 into testing Dec 10, 2024
2 checks passed
@richir-sunet richir-sunet deleted the richir_new_check_uptime branch December 10, 2024 14:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants