Server Management - Systems Insight Manager
1832603 Members
2512 Online
110043 Solutions
New Discussion

Pass the Message Text from an Event to a command

 
Maurice Skubski_1
Valued Contributor

Pass the Message Text from an Event to a command

Hi,

i want to do an automatic action on an Event doing following:
- give the Text and all inforamtion to the script (batch)
- use the information to generate an opcmsg (to send it to OVO)

I need the Variables for:
- Message Text
- Server
- Severity
- IP Address
- ..

Has anyboday made a customer command for this before? if yes, please let me know how to do it.

thanx
ms
4 REPLIES 4
David Claypool
Honored Contributor

Re: Pass the Message Text from an Event to a command

I always forget where this is documented, so I created a custom command that calls the 'set' command and ties it to an event handler. Results from sending a test trap below (edited to omit all but the important stuff):

COMPUTERNAME=BLMASTER
DEVICEIPADDRESS0=192.168.1.3
DEVICEIPADDRESS1=192.168.1.11
DEVICEIPADDRESSCOUNT=2
DEVICEMACADDRESS0=00:11:85:6B:7B:4D
DEVICEMACADDRESSCOUNT=2
DEVICENAME=virtualserver1-team
FP_NO_HOST_CHECK=NO
GENERICTRAPID=6
MPIP0=192.168.1.3
MPIP1=192.168.1.200
MPIP10=null
MPIP100=192.168.1.3
MPIP11=192.168.1.3
MPNAME0=virtualserver1-team
MPNAME1=ilo-slot2
MPNAME10=6U-Enclosure_TV7LMJS33C
MPNAME100=virtualserver1-team
MPNAME11=virtualserver1-team
MX_CMS=blmaster
MX_REPOSITORY=blmaster
MX_TARGETS=virtualserver1-team.bladesystem.net
MX_TASKID=361507_blmaster
MX_TOOL=set
MX_USER=blmaster\administrator
NOTICELABEL=Generic trap (11003)
NOTICEPLAINTEXT="|Event Name: Generic trap (11003)|Event originator: virtualserver1-team|Event Severity: Major|Event received: 17-May-2006, 14:41:03| |Event description: Generic trap.| |Text: Management Agents Test Trap sent - Wednesday, May 17, 2006 2:41:08 PM|"
NOTICERAWDATA="NOTICE_ID=1851510|NOTICE_TYPE=134|DEVICE_KEY=684|TRAP_ENT_OID=1.3.6.1.4.1.232|1.3.6.1.2.1.1.5.0=VIRTUALSERVER1|1.3.6.1.4.1.232.11.2.8.1.0=Management Agents Test Trap sent - Wednesday, May 17, 2006 2:41:08 PM|1.3.6.1.4.1.232.11.2.11.1.0=0|NOTICE_TYPE_STR=Trap.cpqHo2GenericTrap|NOTICE_STATE=2|NOTICE_SEVERITY=Major|TRAP_SPECIFIC_ID=11003|DEVICE=virtualserver1-team.bladesystem.net|TRAP_GENERIC_ID=6|GENERATED=Wed, 5/17/2006, 2:41:03 PM CEST"
NOTICESEVERITY=4
NOTICESEVERITYSTR=Major
NOTICESTATE=2
RELATEDDEVICECOUNT=5
RELATEDDEVICEIP0=192.168.1.3
RELATEDDEVICEIP1=192.168.1.200
RELATEDDEVICEIP10=null
RELATEDDEVICEIP100=192.168.1.3
RELATEDDEVICEIP11=192.168.1.3
RELATEDDEVICENAME0=virtualserver1-team
RELATEDDEVICENAME1=ilo-slot2
RELATEDDEVICENAME10=6U-Enclosure_TV7LMJS33C
RELATEDDEVICENAME100=virtualserver1-team
RELATEDDEVICENAME11=virtualserver1-team
RELATIONSHIP0=MgmtProcToServer_Ilo
RELATIONSHIP1=MgmtProcToServer_Ilo
RELATIONSHIP10=ServerToEnclosure
RELATIONSHIP100=VMGuestToVMHost
RELATIONSHIP11=VMGuestToVMHost
SPECIFICTRAPID=11003
SYSTEMHOSTNAME=virtualserver1-team.bladesystem.net
Maurice Skubski_1
Valued Contributor

Re: Pass the Message Text from an Event to a command

Hi,
and dou you have an example script/batch how i can use the variables and pass them to the script? i'm new in SIM. regards ms
Winfried Baur
Occasional Advisor

Re: Pass the Message Text from an Event to a command

When the Event fires execute a custom Command where you start a Batch File ex. MYBATCH.BAT. As Variables use %DEVICENAME%
In your MYBATCH.BAT write echo %1 and you schold see the servername
regards
Winni
Maurice Skubski_1
Valued Contributor

Re: Pass the Message Text from an Event to a command

hi winni,

good to know. lets talk about it offline in the office. maybe we can make such a tool to test it.

regards
ms