summarylogtreecommitdiffstats
path: root/lsi-msm-snmp.install
blob: 3e1aa5c3e8a177e120fed17a378c0f54dec06b08 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
all_off="$(tput sgr0)"
bold="${all_off}$(tput bold)"
yellow="${bold}$(tput setaf 3)"
blue="${bold}$(tput setaf 4)"
green="${bold}$(tput setaf 2)"

_instructions_install() {
  printf "${yellow}==>${all_off} ${bold}ATENTION:${all_off}
${green}==>${all_off} ${bold}First Steps needed for run 'LSI MegaRAID SNMP Agent':${all_off}
  ${blue}->${all_off} Create or edit the file: '${bold}/etc/snmp/snmpd.conf${all_off}' and put in this content:
     '${bold}pass .1.3.6.1.4.1.3582 /usr/bin/lsi_mrdsnmpmain${all_off}' and save.
  ${blue}->${all_off} Edit the file '${bold}/etc/lsi_mrdsnmp/LSI_StorSNMP.ini${all_off}'
     and comment out the option you want use.
  ${blue}->${all_off} For start '${bold}LSI MegaRAID SNMP Agent${all_off}' service, run:
     '\x23 ${bold}systemctl start lsi_mrdsnmpd${all_off}'.\n"
}

_instructions_update() {
    printf "${yellow}==>${all_off} ${bold}ATENTION:${all_off}\n"
  if [ -f /etc/snmp/snmpd.conf ]; then
    printf "${green}==>${all_off} ${bold}The file '/etc/snmp/snmpd.conf' is found${all_off}.
  ${blue}->${all_off} Please make sure if have this content:
     '${bold}pass .1.3.6.1.4.1.3582 /usr/bin/lsi_mrdsnmpmain${all_off}'
     before start/restart the '${bold}LSI MegaRAID SNMP Agent${all_off}' service.\n"
  else
    printf "${green}==>${all_off} ${bold}The file '/etc/snmp/snmpd.conf' is not found.${all_off}
  ${blue}->${all_off} Please Create and put this content:
     '${bold}pass .1.3.6.1.4.1.3582 /usr/bin/lsi_mrdsnmpmain${all_off}'
     before start/restart the '${bold}LSI MegaRAID SNMP Agent${all_off}' service.\n"
  fi
}

post_install() {
  ldconfig &> /dev/null
  _instructions_install
}

post_upgrade() {
  ldconfig &> /dev/null
  _instructions_update
}

post_remove() {
  ldconfig &> /dev/null
}