Active IQ Unified Manager Discussions

Alarm initiated script

martin_pauke
3,385 Views

Hi,

i want to create some syslog information to a syslog server. My idea is, that a script start at every event and send some Information to a syslogserver with logger $1 $2 $3 .. on cli.

So far so good. The actual state now is, that the script is started from the event trigger and i have checked the Scriptenvironment like this:

Script content:

echo $env > /tmp/om-event$$.log

echo "$(date) $*" >> /tmp/om-event$$.log

The content of the logfile is not what i expected. I expect that there is a envirnment with some content of the event, but there is total nothing

Does anyone know a suitable solution.

Regards

Martin

4 REPLIES 4

marz
3,385 Views

martin_pauke
3,385 Views

marzec schrieb:

Greetings Martin

Check out this FAQ:  https://library.netapp.com/ecmdocs/ECMM1278650/html/faq/index.shtml

Specifically this link for env vars for events:  https://library.netapp.com/ecmdocs/ECMM1278650/html/faq/index.shtml#_7.5

Thank you,

that,s great.

Regards

Martin

adaikkap
3,385 Views

Hi Martin,

      I am not clear on what syslog are you trying. But here is the List of environmental variable that are generated in DFM. This is documented in the following FAQ.

https://library.netapp.com/ecmdocs/ECMM1278650/html/faq/index.shtml#_7.5

Also if you are running your OnCommand server on linux you will have to source file named vars.csh or vars.sh under the following directory.

<installdir>/NTAPdfm/bin

Also while you call the script  in your alarm the format should be as follows. full path of the interpreter and the script path.

Script Name /usr/bin/perl /opt/script.pl

lnx:~ # dfm alarm list

Alarm                1

Group                Global

Event Severity       All

Event Name           All

Time From            00:00

Time To              23:59

Email Addresses xyz@netapp.com

Script Name /usr/bin/perl /opt/script.pl

User Script Runs As  root

Regards

adai

martin_pauke
3,385 Views

Adaikkappan Arumugam schrieb:

Hi Martin,

      I am not clear on what syslog are you trying. But here is the List of environmental variable that are generated in DFM. This is documented in the following FAQ.

https://library.netapp.com/ecmdocs/ECMM1278650/html/faq/index.shtml#_7.5

Also if you are running your OnCommand server on linux you will have to source file named vars.csh or vars.sh under the following directory.

<installdir>/NTAPdfm/bin

Also while you call the script  in your alarm the format should be as follows. full path of the interpreter and the script path.

Script Name /usr/bin/perl /opt/script.pl

lnx:~ # dfm alarm list

Alarm                1

Group                Global

Event Severity       All

Event Name           All

Time From            00:00

Time To              23:59

Email Addresses xyz@netapp.com

Script Name /usr/bin/perl /opt/script.pl

User Script Runs As  root

Regards

adai

Thank you, but my first draft solution is working now.

#! /bin/bash

logger -t $DFM_EVENT_SEVERITY "$DFM_EVENT_ID $DFM_HOST_NAME $DFM_HOST_TYPE $DFM_SOURCE_TYPE $DFM_SOURCE_NAME $DFM_EVENT_NAME_GUI"

smc-vm-025:/etc/syslog-ng # dfm alarm list 13

Alarm                13

Group                Global

Event Severity       All

Event Name           All

Time From            00:00

Time To              23:59

Script Name          /home/mss/scripts/netapp/om-event.sh

that,s first of all the beginning, if i have more time i will insert the Event dependig Variables too.

Now, the OnCommand Mgmt could speak to a syslog Server

Regards

Martin

Public