[Solved]Action configuration - Issue with command execution on management server

Started by vishal21, January 22, 2013, 12:38:12 PM

Previous topic - Next topic

vishal21

I am trying to integrate NetXMS with CA Unicenter in order to generate automated tickets.

For this I am using a utility from CA called "cawto". With this utility I can send an event to the CA NSM server with the alert message as generated by NetXMS. Based on the received event, CA NSM then creates ticket in CA Unicenter. I am using below command as an Action in NetXMS to send the events to NSM.


//opt//CA//SharedComponents//ccs//bin//cawto -n waqnsm91 NETXMS - ALERT - %n - %a - %m


Where waqnsm91 is my CA NSM server.

Condition 1:This works perfectly and I can see an event in CA NSM when the contents of message variable %m is in plane text or without any special characters like below,
%m = Node down.

Condition 2: But the command execution fails if the contents of message variable %m is having some characters like " or () or / .

Ex.
%m = Interface "Ethernet100/1/47 (Temp Laptop Connections)" changed state to DOWN (IP Addr: 0.0.0.0/0.0.0.0, IfIndex: 526584704)

In this case, since the message contains the IfName and IfAlias it comes with a slash / and the bracket () which causes the execution to fail.

To verify this I am executing a parallel action as below,


echo HOST - %n - %a - %m >> //home//vishalb//netxms.log


Please help me to get this fixed if anyone also faced this issue.

Thanks in Advance.

Vishal Babrekar

Victor Kirhenshtein

Hi!

You have to escape text properly before passing to command line, or enclose text in quotes. Try to define your command as


/opt/CA/SharedComponents/ccs/bin/cawto -n waqnsm91 NETXMS - ALERT - %n - %a - '%m'


Btw, you don't need to put / twice - only the backslash (\).

Alternative approach could be to use NXSL script to escape special characters in event message with backslash.

Best regards,
Victor

vishal21

Great!! Thanks Victor.

Adding the '%m' seems to have fixed this issue. Because I am seeing the desired output in my log file //home//vishalb//netxms.log. I am now checking with my CA team if they are receiving it correctly or not. I'll update you soon.


Thanks,
Vishal Babrekar

vishal21

Hi Victor,

Its now confirmed that CA NSM is receiving NetXMS alerts correctly and now they also started auto generated incident creation in CA Unicenter. So we can confirm that this integration of NetXMS with CA Unicenter worked well.

For those who are also looking for integrating NetXMS with CA Unicenter for creation of auto generated incidents can also refer this.

Thanks,
Vishal Babrekar