Support of exit codes

Ideas for new features & functions

Moderators: Dorian (MJT support), JRL

Post Reply
slanger
Newbie
Posts: 2
Joined: Sun Nov 19, 2006 6:10 pm

Support of exit codes

Post by slanger » Sun Nov 19, 2006 7:26 pm

It seems that both macros and compiled Exe´s do not support a very common and basic function for programs: exit codes or return codes
(see also http://en.wikipedia.org/wiki/Exit_code or http://www.itworld.com/Comp/1375/nls_un ... index.html)

It would be a very important enhancement for Macro Scheduler, because some basic technologies use this basic function.

For instance:
I want to use macros or compiled Exe´s to check the function of any application from a users view as a part of a complex system monitoring solution based on nagios (http://www.nagios.org). With the help of nrpe_nt (http://www.miwi-dv.com/nrpent/) it´s possible to start scripts or executables on remote windows workstations. nagios/nrpe_nt use exit codes to transfer results (status information: ok, warning, critical) to the nagios process. If Macro Scheduler would support exit codes I could use it for enterprise application monitoring. I´m sure, that this is a very interesting use of Macro Scheduler for many other people, too.

User avatar
Marcus Tettmar
Site Admin
Posts: 7380
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK
Contact:

Post by Marcus Tettmar » Sun Nov 19, 2006 8:23 pm

The Run Program command does support exit codes. The exit code is put in the RP_RESULT variable.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?

slanger
Newbie
Posts: 2
Joined: Sun Nov 19, 2006 6:10 pm

Post by slanger » Mon Nov 20, 2006 9:38 am

O.k.
I understand that macros can "read" exit codes, that are returned by programs, that were started by the macro.
What I need is following: I want to start a created macro or a compiled Exe from another program or script. That program or script expects, that the called program returns a specific exit code. Macros an compiled Exe´s created by Macro scheduler schould return exit codes to calling programs.

User avatar
pgriffin
Automation Wizard
Posts: 460
Joined: Wed Apr 06, 2005 5:56 pm
Location: US and Europe

Post by pgriffin » Mon Nov 20, 2006 2:57 pm

Ok, I maybe I'm missing something, but having written a fair amount of code.....Sounds like you want you Macro or EXE to just work like a self-contained function. So, in that case, WRITE it that way. There are endless ways to send data program to program.

Have the macro written to accept certain vars, or even have it run differently based on WHICH vars are sent to the macro, then have it write results to an intermediate file like a database, text file, etc....from this intermediate location have your program read the results...

I understand that this is just an enhancement suggestion, but if you could post a specific problem you are trying to solve, this forum can almost always find a solution.

User avatar
Marcus Tettmar
Site Admin
Posts: 7380
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK
Contact:

Post by Marcus Tettmar » Mon Nov 20, 2006 2:59 pm

Don't forget you can also have a macro return results to the calling macro with the MACRO_RESULT variable.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?

Post Reply
Sign up to our newsletter for free automation tips, tricks & discounts