equal
deleted
inserted
replaced
|
1 #!/bin/bash |
|
2 # Script generated by Puppet. It's executed when you run: |
|
3 # puppi todo <%= @name %> |
|
4 # |
|
5 # Sources common header for Puppi scripts |
|
6 . <%= scope.lookupvar('puppi::params::scriptsdir') %>/header || exit 10 |
|
7 |
|
8 echo_title "$HOSTNAME - <%= @name %>" |
|
9 |
|
10 <% if @description != "" -%> |
|
11 cat <<EOF |
|
12 <%= @description %> |
|
13 EOF |
|
14 <% end -%> |
|
15 |
|
16 <% if @notes != "" -%> |
|
17 cat <<EOF |
|
18 <%= @notes %> |
|
19 EOF |
|
20 <% end -%> |
|
21 |
|
22 <% if @run != "" -%> |
|
23 <% @array_run.each do |cmd| %>show_command "<%= cmd -%>" |
|
24 <% end -%> |
|
25 <% end -%> |
|
26 |
|
27 <% if @check_command != "" -%> |
|
28 <%= @check_command %> |
|
29 if [ "x$?" = "x0" ] ; then |
|
30 echo_success |
|
31 result="OK" |
|
32 else |
|
33 echo_failure |
|
34 result="CRITICAL" |
|
35 EXITCRIT="1" |
|
36 fi |
|
37 <% else -%> |
|
38 echo_warning |
|
39 result="WARNING" |
|
40 EXITWARN="1" |
|
41 <% end -%> |
|
42 |