Community discussions

MikroTik App
 
tjcstuart
just joined
Topic Author
Posts: 5
Joined: Tue Aug 12, 2014 10:27 pm

Syslog help please!!

Wed Aug 13, 2014 2:06 am

I have my syslog passthrough everything, logging as it goes, then I want it to execute Locally a command. I have the execute Locally setup, and when I issue a test it comes through perfectly.
But when in the syslogs rules I never get the packet. I've double checked the order of things and it SHOULD be working.
But I have another one, that accepts and goes to syslog without e-mailing and that one seems to work just fine.
Even tried putting my “packetSend” notification as the first thing and using accept it never issues the packet.

I guess this must be an issue with The Dude not being able to execute the command from a syslog rule. But it can do so via the Test. Any ideas how I can get this to work?

Any help is appreciated!
You do not have the required permissions to view the files attached to this post.
 
User avatar
normis
MikroTik Support
MikroTik Support
Posts: 26376
Joined: Fri May 28, 2004 11:04 am
Location: Riga, Latvia

Re: Syslog help please!!

Wed Aug 13, 2014 1:11 pm

It could be a bug. Have you tried Dude v4beta3? It works better in many ways
 
tjcstuart
just joined
Topic Author
Posts: 5
Joined: Tue Aug 12, 2014 10:27 pm

Re: Syslog help please!!

Wed Aug 13, 2014 11:25 pm

I upgraded to 4.0 Beta 3 and same issue.
The Command I want to execute is "C:\Program Files (x86)\PacketSender\PacketSender.com" -a 172.16.2.87 1010 "Critical"

I then took that same command and created a .bat file c:\critical.bat. Tried setting the execute locally notification to c:\critical.bat and still nothing.

Again when clicking the TEST button it works just fine, both the full command and the batch file. But when in the syslog rules it fails.

I have tried running dude as a service, also changing the service to use a local admin account. Tried running dude with administrator rights by right clicking and nothing seems to work...

I'm on Windows Server 2008 R2 Standard if that matters...
 
tjcstuart
just joined
Topic Author
Posts: 5
Joined: Tue Aug 12, 2014 10:27 pm

Re: Syslog help please!!

Thu Aug 14, 2014 2:04 am

More info...
I've now installed a second copy of The Dude on a Windows Server 2003 R2 (64bit) SP2 box.
The very same issue is happening on here. No matter what I create for a batch file it simply will not execute as a notification. I've tried the command I want, and even something simple like "echo test >> c:\test"
Using the Test button it works every time. But as a Syslog rule it just does nothing.

Again The Dude is running as a service, starts with an admin account.
Is there any kind of advanced debug logs I can turn on so I can see why this is failing? I see a Debug under logs, but nothing ever populates in it.
 
lebowski
Forum Guru
Forum Guru
Posts: 1619
Joined: Wed Aug 27, 2008 5:17 pm

Re: Syslog help please!!

Wed Aug 20, 2014 7:59 pm

I have seen execute do weird things with different types of executable files that were not named program.exe so maybe just rename it to PacketSender.exe?

Note in 4.3 execute requires \\ as in [execute("test.bat","test.txt","c:\\")]

I have had more luck specifying the path separately but I am not currently using execute for anything so I don't have experience with keeping an execute item functioning.

I am sure you read this... Execute:
executes a program, returns array of three elements - return code, standard output, standard error. return code is -1 if error occurs. Only first parameter mandatory. First paramerter - command, second - parameters, third - path, forth - input string to pass to program, fifth - timeout in seconds (default 5.0)

But I do not know what "parameters" it wants if you can specify the "input string" then what are the "parameters"?

There is another funky thing too, -1 as a return code can evaluate to true in the error line of a probe so you will have to add and subtract 1 if you find this funkiness in your setup.

Also search the dude forum for execute.

GL
Lebowski
 
gianmaxfactor
just joined
Posts: 19
Joined: Wed Nov 15, 2017 6:25 pm

Re: Syslog help please!!

Wed Nov 15, 2017 6:29 pm

The import of the old 4.0 beta 3 over the new Dude v6 is almost perfect (or it seems to be) but the "execute" function that is not more found

How can I use the execute function to run Windows .bat files as on the old Dude v4 ?

Thanks
Gian

Who is online

Users browsing this forum: No registered users and 10 guests