I have been searching the forums and don’t seem to be able to find a way to do this so I thought I’d ask.
I am looking at getting The Dude to write a custom XML file to a folder on the hard drive when a notification occurs. For example if the Ping to a specific units IP fails i would like to to create a new XML file with some details in it.
<SMS_Batch>
<Reference_Number>“time”</Reference_Number>
Ping to unit name failed at time
<Mobile_Number>“cell number1”</Mobile_Number>
</SMS_Batch>
Is there any way to do this?
Please let me know if there is any more info i can give.
You could easily write a batch job and call it with an external.
You can pass parameters to a batch job and incorporate them by referencing them as %1, %2, %3…
So you would run your batch job like so.
In the Dude, add a a new notifications: NOTE: This is just an example the exact text I don’t know but this is close…
Name: pingfail
Type: execute on server
Command: pingfail.bat [device.name] [device.stuff]
pingfail.bat would look like below and %1 would be device.name, %2 would be device.stuff.
You need to escape special chars to make sure they are “echoed” out to the file.
The single > creates a new file where >> writes to an existing file.
Thank you for you help that seems like it will do what i need it to.
I am having 2 issues though that i really hope you can help me with.
The bat file i create will create/write to a file if i run it out of it’s directory. It seems to try run from the dude but does not actually write to the file. Do you have any ideas why this might be? I paused at the end of the file and it seems to be running all the way through either way i run it.
If I put “echo SMS_batch >pingf.xml” at the top it will write to the file but if it’s “echo /<SMS_Batch/> >pingf.xml” I get an error stating “> was unexpected at this time”
Edit ** Ignore 2 i managed to find that the escape character i needed was a ^ … seems to be working now. 1 However is still a problem.
Edit ** I have managed to solve the issue i was having with the batch file not running. I created a shortcut to the batch file and told the dude to link to and send variables to it. Seems to be working great now. Thank you Very much for all your help.