Active IQ Unified Manager Discussions

customizing mails from ocum 7.1

Tomer_Schweid
7,596 Views

I am trying to customize the mails which come from the ocum alerts.

 

I saw that there is no built in functionallity in the product but it is possible to do this by script.

 

The OCUM is a virtual aplliance, does that mean it does not support powershell scripts?

 

I tried a simple test to upload a script like that:

 

Send-MailMessage -From DFM@localdomain.com -To Tomer.Schweid@localdomain.com -Subject "Test" -Body "This is a test message" -SmtpServer mailhost.localdomain.com

 

(domain name was replaced).

 

When running manually it sends the email so the command is fine. 

 

The OCUM also sends it's own built in mails so it's not that nothing happend, I get the default mails and don't get the test one.

 

If someone could please tell me what is the problem it would be greatfull. Also, if you could provide a shell script that does the same it would be great.

 

My next step afterwards is to get environment variables so the mails would make sense so if you guys know this it would also save me some time.

 

Thanks in advance,

Tomer

6 REPLIES 6

mbeattie
7,589 Views

Hi Tomer,

 

To help troubleshoot the problem, could you please attach the logs from the date time the alarm\event is generated.

To enable verbose logging please perform the following steps.

 

  • Enable verbose debug logging for the “logback-server.xml” within the “NetApp Packages” section by adding the highlighted line below to enable the logs to capture the script errors and event argument variables. EG:
 C:\Program Files\NetApp\essentials\jboss\server\onaro\conf\logback-server.xml

<!-- NetApp Packages -->
    <logger name="com.netapp" level="INFO"/>
    <logger name="com.netapp.dfm" level="DEBUG"/>
    <logger name="com.netapp.nwf" level="WARN"/>
    <logger name="com.netapp.autozapi.server" level="DEBUG"/>
    <logger name="com.netapp.um.script.service" level="DEBUG"/>
  • Restart the OCUM services
  • Ensure the OCUM alert is configured and the script is attached to the alert
  • Invoke the action that triggers the OCUM alarm\event (which will trigger the script)
  • Perform a storage rediscovery or wait for OCUM poll the storage and trigger the alert\script and generate the events. EG
  • Check the “ocum-script” log file. The default location of the log is: C:\ProgramData\NetApp\OnCommandAppData\ocum\log\ocum-script.log

Note: for the RHEL or vApp version the log will be "/var/log/ocum/ocum-script.log"

 

Please check the log for any errors and post the results. Hope that helps

 

/Matt

If this post resolved your issue, help others by selecting ACCEPT AS SOLUTION or adding a KUDO.

Tomer_Schweid
7,566 Views

First of all, thank you Matt.

 

I will need to check if it is possible to make this change.

Anyways, when I SSH to the server I do not have a normal shell so I don't think I could access the log or even make the change itself.

 

All I get is:

 

 

Main Menu:
 --------------------------
    1 ) Upgrade (Disabled. Must be run on virtual machine console.)
    2 ) Network Configuration
    3 ) System Configuration
    4 ) Support/Diagnostics

    x ) Exit

 Enter your choice:

 

mbeattie
7,530 Views

Hi Tomer,

 

Here is the KB to access the OCUM vAPP in the diag shell.

 

https://kb.netapp.com/support/s/article/ka31A00000012qfQAA/How-to-access-the-OnCommand-Virtual-Machine-DIAG-shell

 

Hope that helps

 

/Matt

If this post resolved your issue, help others by selecting ACCEPT AS SOLUTION or adding a KUDO.

mbeattie
7,471 Views

Hi Tomer,

 

Here are some instructions for you for enabling debug logging for the script service for the OCUM vSphere vApp version.

 

 

diag@TESTOC71P1:/$ sudo service ocie status
[ ok ] ocie is running.
diag@TESTOC71P1:/$ sudo service ocie stop
[ ok ] Stopping NetApp OnCommand Insight Essentials Server service: ocie.
[info] Waiting for ocie to shut down.
.......
  • Change directories to locate the "logback-server.xml" file
diag@TESTOC71P1:/$ cd /opt/netapp/essentials/jboss/server/onaro/conf/
diag@TESTOC71P1:/opt/netapp/essentials/jboss/server/onaro/conf$ sudo vi logback-server.xml
  • Browse file using the arrow keys to find the XML section named "NetApp Packages"
  • Press "i" to enter insert mode and enter the line in bold text below to enable debug logging for the um.script.service:

       <!-- NetApp Packages -->
        <logger name="com.netapp" level="INFO"/>
        <logger name="com.netapp.dfm" level="DEBUG"/>
        <logger name="com.netapp.nwf" level="WARN"/>
        <logger name="com.netapp.autozapi.server" level="DEBUG"/>
        <logger name="com.netapp.um.script.service" level="DEBUG"/>
  • Press ":wq" to save and quit vi.
  • Verify that the file is updated successfully

    diag@TESTOC71P1:/opt/netapp/essentials/jboss/server/onaro/conf$ cat logback-server.xml | grep "um.script.service"
        <logger name="com.netapp.um.script.service" level="DEBUG"/>
  • Start the ocie service

    diag@TESTOC71P1:/var/log/ocum$ sudo service ocie start
    [ ok ] Starting NetApp OnCommand Insight Essentials Server service: ocie.
  • Verify the OCIE service is running

    diag@TESTOC71P1:/var/log/ocum$ sudo service ocie status
    [ ok ] ocie is running.
  • Change directories to the script log file location:

    diag@TESTOC71P1:/$ cd /var/log/ocum
  • Initiate the action that will cause the OCUM alarm to generate an event and trigger your script
  • Check the "ocum-script.log"

    diag@TESTOC71P1:/var/log/ocum$ cat ocum-script.log

 

When you check the log file it will display:

 

  • The details for scripts that have been triggered via OCUM alarms
  • The scripts event argument variables.
  • The scripts exit code is (0 = success; 1 = failed)

 

Hope that helps

 

/Matt

 

If this post resolved your issue, help others by selecting ACCEPT AS SOLUTION or adding a KUDO.

Tomer_Schweid
7,438 Views

Thanks a lot!

 

I have another projects to do so I won't be able to clear time for this in the near future.

I will look into it when I can and update.

 

Thanks again,

Tomer

mbeattie
7,398 Views

Hi Tomer,

 

The OCUM vApp is based on Debian and supports shell or Perl scripts (not powershell) so you'd have to use sendmail. EG:

 

https://www.tutorialspoint.com/perl/perl_sending_email.htm

 

Also added some additional info here on troubleshooting:

 

https://community.netapp.com/t5/OnCommand-Storage-Management-Software-Discussions/OnCommand-Unified-Manager-alert-script-integration/m-p/128784#M23129

 

/Matt

If this post resolved your issue, help others by selecting ACCEPT AS SOLUTION or adding a KUDO.
Public