KiwiMonitor.com

Kiwi tools support Forum
It is currently Thu Sep 19, 2019 10:19 am

All times are UTC




Post new topic Reply to topic  [ 8 posts ] 
Author Message
 Post subject: multiple instances
PostPosted: Thu Apr 05, 2012 11:06 am 
Offline

Joined: Thu Apr 05, 2012 11:03 am
Posts: 4
I need to run multiple instances of the same EXE, each with a different set of startup parameters.

And then, also multiple instances of a different program, that has the exact same name as the one above.

Eg: - two different programs, named the same, each running three instances with different start up parameters

- folder1\myexe.exe -config=1
- folder1\myexe.exe -config=2
- folder1\myexe.exe -config=3

- folder2\myexe.exe -config=1
- folder2\myexe.exe -config=2
- folder2\myexe.exe -config=3


Top
 Profile  
 
 Post subject: Re: multiple instances
PostPosted: Fri Apr 06, 2012 11:41 am 
Offline
Site Admin
User avatar

Joined: Mon Jan 16, 2012 11:35 am
Posts: 110
There is an example in the advanced rules (Examples => Advanced => 2.) describing a similar problem.

The key is to run these instances with Kiwi, so it can obtain their unique identification numbers (PID).
These are then stored in Kiwi's "global numeric values" so they can be accessed from different set of rules within Kiwi.

If you don't run these apps with Kiwi you can still enter their PID manually.
So these monitored apps can have the same name and the same folder or not...


Top
 Profile  
 
 Post subject: Re: multiple instances
PostPosted: Fri Apr 06, 2012 12:09 pm 
Offline

Joined: Thu Apr 05, 2012 11:03 am
Posts: 4
Thanks, if I can ask a followup question. You said "run these instances with Kiwi". By that do you mean my instances will run as a service, managed by Kiwi? I specifically don't want these instances to be running as a service. (In fact the reason I am looking at Kiwi is I presently use a system that does automatically restart the applications, by running them as services. But the application I want to run does not behave well when run as a service.)

Thanks.


Top
 Profile  
 
 Post subject: Re: multiple instances
PostPosted: Fri Apr 06, 2012 3:50 pm 
Offline
Site Admin
User avatar

Joined: Mon Jan 16, 2012 11:35 am
Posts: 110
No, not as services

I mean it's easier for the applications to be monitored if they are launched by kiwi, so it can obtain their PIDs


Top
 Profile  
 
 Post subject: Re: multiple instances
PostPosted: Sat Apr 07, 2012 11:20 am 
Offline

Joined: Thu Apr 05, 2012 11:03 am
Posts: 4
I bought the Pro but cannot make this work. I am expecting Kiwi to launch the instances of my application, not just monitor them. So that if the server reboots, all of my instances will fire back up. Getting the PID indicates that the application needs to be running first in order for Kiwi to monitor it. But the PID for a given instance will change every time the application is stopped/started, so that won't work. Do I have the concept of Kiwi wrong - I expect it to monitor my applications and restart them if they are down, typically from a server restart, but also if the CPU is high, and other conditions.


Top
 Profile  
 
 Post subject: Re: multiple instances
PostPosted: Sat Apr 07, 2012 7:56 pm 
Offline
Site Admin
User avatar

Joined: Mon Jan 16, 2012 11:35 am
Posts: 110
I've build a sample script for you (attached bellow). Download it and import it in the advanced rules (Advanced rules => Import)

It's designet to launch 3 instanced of the same app with different configs only once, when Kiwi starts.
Then monitor and re-launch the one which closes


Attachments:
File comment: Unzip and import
Kiwi_Export.zip [1.01 KiB]
Downloaded 1120 times
Top
 Profile  
 
 Post subject: Re: multiple instances
PostPosted: Sat Apr 07, 2012 11:49 pm 
Offline

Joined: Thu Apr 05, 2012 11:03 am
Posts: 4
This works sort of, here are some issues:

- When I go in to edit mode, and save the config and go back to the list of applications, it starts opening multiple redundant instances of my application. So I have the three originally started by Kiwi, and now three more phantoms. Since Kiwi now thinks these new redundant instances are the ones it should manage, if I kill them, they are restarted. I'd have to kill the original three, but that is a big problem because these are Web Service instances and I will knock everyone off. I know the solution is to not go in to edit mode, or not stop/start Kiwi but it seems like some control is missing.

- I'd like to manage these instances separately, not all under one "monitored application". I need to be able to stop/start an individual instance.

- There doesn't seem to be a way to stop/start an application through Kiwi. I can remove, add or edit, but not start/stop the application. Since I also cannot stop the application normally (because Kiwi will restart it), I am stuck.


Top
 Profile  
 
 Post subject: Re: multiple instances
PostPosted: Sun Apr 08, 2012 8:11 am 
Offline
Site Admin
User avatar

Joined: Mon Jan 16, 2012 11:35 am
Posts: 110
Oh, I see

You can put each instance in it's own rules, so you have 3 "monitored apps" if you wish


To be able to Edit rules and not restart them you can add a condition to it and move the element that first starts the app under it:
Condition: "Kiwi: value of global numeric variable XX is lower than YY" - where YY could be 1 (when Kiwi starts, variable is 0, containing no PID value, when editing, it has a value)
Picture attached

To be able to manually stop one of your monitored apps you can disable the specific monitored app's rules (Edit => Enable advanced rules (lower right corner)). Now the monitoring is paused and you can close an instance. When done, enable the rules back.

You can also construct a new set of rules (4th "monitored app") which are executed only manually and close a specific instance:
Condition: "Kiwi: only manual execution"
Action: "XX app (PID): close" - with PID being the value of variable #1
You can then execute these rules via main window (right click: execute advanced rules) or right click the Kiwi icon in the notification area


Attachments:
File comment: Rules with a condition
Image1.jpg
Image1.jpg [ 415.53 KiB | Viewed 18214 times ]
Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 8 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group