dev/provisioning/modules/puppi/templates/info/instance.erb
changeset 28 b0b56e0f8c7f
equal deleted inserted replaced
27:a2342f26c9de 28:b0b56e0f8c7f
       
     1 #!/bin/bash
       
     2 # <%= @description %>
       
     3 # Script generated by Puppet. It's executed when you run:
       
     4 # puppi info <%= @name %>
       
     5 #
       
     6 # Sources common header for Puppi scripts
       
     7 . <%= scope.lookupvar('puppi::params::scriptsdir') %>/header || exit 10
       
     8 
       
     9 <% if @configdir != "" -%>
       
    10 # Show config info
       
    11 echo_title "$HOSTNAME - <%= @name %>: Configurations directory: <%= @configdir %>"
       
    12 show_command "ls -latr <%= @configdir %>"
       
    13 <% end -%>
       
    14 
       
    15 <% if @datadir != "" -%>
       
    16 # Show data dir
       
    17 echo_title "$HOSTNAME - <%= @name %>: Application data are in: <% datadir.each do |item| %><%= item %><% end %>"
       
    18 <% @datadir.each do |item| -%>
       
    19 show_command "ls -latr <%= item %>"
       
    20 <% end -%>
       
    21 <% end -%>
       
    22 
       
    23 <% if @bindir != "" -%>
       
    24 # Show bin dir
       
    25 echo_title "$HOSTNAME - <%= @name %>: Startup scripts are in: <% bindir.each do |item| %><%= item %><% end %>"
       
    26 <% @bindir.each do |item| -%>
       
    27 show_command "ls -latr <%= item %>"
       
    28 <% end -%>
       
    29 <% end -%>
       
    30 
       
    31 <% if @logdir != "" -%>
       
    32 # Show log dir
       
    33 echo_title "$HOSTNAME - <%= @name %>: Logs are in: <% logdir.each do |item| %><%= item %><% end %>"
       
    34 <% @logdir.each do |item| -%>
       
    35 show_command "ls -latr <%= item %>"
       
    36 show_command "tail -30 <%= item %>/catalina.out"
       
    37 <% end -%>
       
    38 <% end -%>
       
    39 
       
    40 <% if @run != "" -%>
       
    41 echo_title "$HOSTNAME - <%= @name %>: Extra info"
       
    42 <% @run.each do |cmd| %>show_command "<%= cmd %>"
       
    43 <% end -%>
       
    44 <% end -%>
       
    45 
       
    46 
       
    47 <% if @servicename != "" -%>
       
    48 # Show service info
       
    49 echo_title "$HOSTNAME - <%= @name %>: Services: <% @servicename.each do |item| %><%= item %><% end %>"
       
    50 <% @servicename.each do |item| -%>
       
    51 show_command "/etc/init.d/<%= item %> status"
       
    52 <% end -%>
       
    53 <% if @verbose == "yes" -%>
       
    54 show_command "ps -adef | grep java | grep <%= @processname %>"
       
    55 <% else -%>
       
    56 show_command "ps -adef | grep java | grep <%= @processname %> | head -20"
       
    57 <% end -%>
       
    58 <% end -%>
       
    59 
       
    60 <% if @httpport != "" -%>
       
    61 # Show port info
       
    62 echo_title "$HOSTNAME - <%= @name %>: httpport - <%= @httpport %>"
       
    63 <% if @verbose == "yes" -%>
       
    64 show_command "netstat -natup | grep ':<%= @httpport %> '"
       
    65 <% else -%>
       
    66 show_command "netstat -natup | grep ':<%= @httpport %> ' | head -20"
       
    67 <% end -%>
       
    68 <% end -%>
       
    69 
       
    70 <% if @controlport != "" -%>
       
    71 # Show port info
       
    72 echo_title "$HOSTNAME - <%= @name %>: controlport - <%= @controlport %>"
       
    73 <% if @verbose == "yes" -%>
       
    74 show_command "netstat -natup | grep ':<%= @controlport %> '"
       
    75 <% else -%>
       
    76 show_command "netstat -natup | grep ':<%= @controlport %> ' | head -20"
       
    77 <% end -%>
       
    78 <% end -%>
       
    79 
       
    80 <% if @ajpport != "" -%>
       
    81 # Show port info
       
    82 echo_title "$HOSTNAME - <%= @name %>: ajpport - <%= @ajpport %>"
       
    83 <% if @verbose == "yes" -%>
       
    84 show_command "netstat -natup | grep ':<%= @ajpport %> '"
       
    85 <% else -%>
       
    86 show_command "netstat -natup | grep ':<%= @ajpport %> ' | head -20"
       
    87 <% end -%>
       
    88 <% end -%>
       
    89