Howto:IQM server as a service

From innovaphone-wiki

Revision as of 09:15, 10 August 2018 by Ani (Talk | contribs)
(diff) ←Older revision | Current revision (diff) | Newer revision→ (diff)
Jump to: navigation, search

The iQM Server can be started also as a service using a utility.

The advantage starting an iQM server as a service is that no user login is necessary and therefor the service can start automatically when the PC starts up.

Services have no user interface as they run “in background” and they are user independent. All files are stored in absolute directory like “c:\myiQM\” and require therefore admin rights.

From a client point of view there is no difference between having the service or normal executed version s server.


Contents

Applies To

This information applies to

iQM server Build 80075 and later.


Installing the iQM server as a service - Walkthroughs

First initial iQM setup

Before starting you should have a clear idea where and how install the iQM and how a iQM server works with the setup directories.

This is also explained in the article “IQM command line arguments”. This article as well as the article “IQM_remote_control” should be read before starting.

When you install an iQM with the innovaphone installer package the iQM server is installed in a directory like this one “c:\Programms (86)\innovaphone\QueueMonitor\iQM”. You can execute the iQM from this position but also copy the iQM.exe in a simpler directory like “c:\myiQM\”; just copy the .exe in that directory. To avoid that a user start the iQM in the original path you can also remove the iQM server using the Windows control panel (Programs and Features).

iQM.exe is a self-containing software that requires no external dll or other files and can be start just clicking on it. Decide where the setup and all other parameters should be stored. In our example we decide to store all that in a sub directory where the .exe is running, so we create a directory in “c:\myiQM\data\”.

Note: If you are already operating a iQM server and want maintain all counters, logs and setup copy the entire content of the actual directory (just follow in the iQM setup the link) in this new directory.

Remember that the iQM must be started from now on with administrator rights (typical) or have in any way the right to access and modify files in the “c:\myiQM\data\” directory.

If you start the iQM server he will try first to find a setup file in your user directory, so open your setup and enter the path “c:\myiQM\data\” and stop the iQM. Starting next time the iQM will search and store the setup data in this directory.

Now run the iQM server normally and do all the setup. Then start some Agent (on the same PC or on a separate one) and test that even there anything works fine as requested.


Configuring IQM Server as service

Before continue: IQM server has to be already configured and tested.

On Windows, Right click on the start button and select "Control Panel"

On top right, change the view from "Category" to "Small icons"

Open "Administrative Tools" and double click on "Task Scheduler"

On the Tab "Actions" on the left, click on "Create Task" and a new window will open.

Give a task name like "IQM Server", a description if desired, choose the account that should run the program and choose "Run whether user is logged on or not"


Image:IQMServicecreatetask.PNG



Select the next tab "Triggers", click "New" a new windows will appear.

On the "Begin the task" select "At startup" and check that on the bottom the "Enabled" is flagged, then click "ok".


Image:IQMServicenew trigger.PNG


Select the next tab "Actions", on the bottom left click "New"

A new window appear, on the Action tab select "Start a program" , then click on "browse" and choose the IQM.exe file that usually is located in " C:\Program Files (x86)\innovaphone\QueueMonitor\iQM " , check that the correct path is written in the "Program/script" tab and then click "ok"


Image:IQMServiceActions.PNG


Select next tab "Conditions" and unflag the option "Start task only if the computer is on AC power"


Image:IQMServiceconditions.PNG


Select the next tab "Settings"

Put the flag on "If the task fails, restart every:" and leave "1 minute" and "Attempt to restart up to:" "3 times"

Remove the flag from "Stop the task if it runs longer than:" and press "OK"


Image:IQMServiceSettings.PNG


A popup will display, asking you to insert the password of a user with the rights to create tasks (usually the administrator) and press "OK"

Now, on the tasks list, the new IQM Server task should be displayed.


Image:IQMServicecheck.PNG


To test this, just restart the PC, and after the login check that in the task manager the IQM service is running.


Image:IQMServicetask manager.PNG


Change IQM configuration

After starting the IQM as service, you will notice that you won't be able to open it's main screen while is running. If you try to open it, it will open another IQM server instance. Said that, to modify the IQM server setting, stop the IQM Server as described in the next chapter.


Control and Stop the iQM service

Once the iQM service is started you can control the status and send commands to the iQM server using a iQM agent. See relative article “remote control”.

Do never terminate the process using the task manager or similar, stop a iQM server always with the exit button on a iQM Agent. Just in this way all counters are saved correctly and the service is shut down in a controlled way. Killing the service with the task manager is for the iQM mostly like switching off the power of the PC.

If you stop the iQM serve as a service using the Exit Key in the iQM Agent the application will be safely stopped as described. Please note that the Process will reamin loadet as service. If terminated i and can be started again with the “net start iQM_SERVICE” command.

So if you have to do complicated changes in the setup or install new features feel free to stop the service using the agent as described. Once stopped just start the iQM in foreground, do all your changes and checks. Once done stop the iQM and start the service again.

Run more the one IQM Server instance as service

Sometimes there is the need to run more then one IQM Server on the same PC. To do so, we need to take in consideration that the settings of the IQM are by default saved in this folder

"C:\Users\$User\AppData\Roaming\IQM " if not changed (so also the second instance will use this)

The first thing to do then, is to change where the second IQM Server instance store his data (you should already have copied the IQM folder to a new folder for the second instance) To do this open the second IQM Server instance, click on the wheel on the bottom left and setup page will open. In the "DATA LOGGING" tab, click the "set" button near the "Log directory". A popup will open, asking you to select the folder where this IQM instance will save his log and settings file. Create and/or choose the destination folder (for example c:\IQM2) and click ok. Click on "Save and exit" and close the IQM.


Image:setupIQMServer.PNG


Now, when creating the task for the second IQM Server, follow the same instruction except for the "Action" page. In this page, you have to configure the path where the second IQM Server .exe is located, and in "Add arguments (optional) " IQMPATH=c:\IQM2 " . This way, we tell the Program that those setup files are located in that directory.


Image:IQMServiceActions2.PNG


Run iQM server setup

If you want modify the setup of the iQM server you have two options: you can stop the service, start the iQM normal and open the setup or you start the iQM server with the “setup” option. This can be done even during operation, but remember that many parameters require a restart and therefore you have to stop and restart the service.

Please note that running two or more iQM on the same working directory causes unpredictable results. For example one iQM could try to open a file while a second one try to delete this. In any case the “latest” will win because he will overwrite data with “his” own data. So do never run two iQM on the same directory, even if one is working on background as a service. Just in setup mode this can be done in a safe mode.

Related Articles

Howto:IQM_command_line_arguments

Howto:IQM_remote_control

Howto:Queue_Monitor_-_Overview

Personal tools