Contents
Overview and Installation
What is the Batch Manager?
The Batch Manager is an application which connects to one or more OpenMFG databases and waits for and then processes batched jobs that need to be run. These batched jobs are submitted from various places within the OpenMFG application. Often the type of jobs that can be submitted are jobs that either take long periods of time to run or jobs that you would want to run periodically at a given time. When you submit a job to the Batch Manager, you specify a time to for the job to start running. This job and others like it are stored on the database, waiting for the Batch Manager to process them. You can see a list of jobs by selecting the “Batch Manager” option in the System Module. It is here you will also have the ability to reschedule any job, as well as cancel pending jobs. The same screen you see in the System Module and its information are also accessible from within the Batch Manager itself. If the Batch Manager sees a pending job that is past due, it will process that job immediately. Once the job is completed, the submitting user will receive either a System Message or an email message—depending on the type of job it is. If a job has been scheduled to be run periodically, then a new job will be submitted for each interval in the specified period (i.e., daily, weekly, or monthly). This cycle of processing jobs will continue as long as the Batch Manager is running.
What Operating Systems can the Batch Manager Run On?
The Batch Manager will on work on the Red Hat Linux, Mac OS X, and Windows platforms.
What do I need to run the Batch Manager?
The Batch Manager is a GUI based client. As such, it must be run from within a graphical environment. Because of this, you cannot just run it as a background process when a computer is booted up. If you are running the Batch Manager on Red Hat Linux, we recommend that a VNC server session be set up. This session can be configured to automatically start the Batch Manager, and the session itself can be started as a service that is run when the computer is booted. We discuss running the Batch Manager as a service on Red Hat Linux later in this document.
Additional Required Tools
Depending on your operating system, some additional tools may be required for the Batch Manager to perform its tasks. If required, these tools must be executable via some means by the Batch Manager. In most cases, this means that the $PATH variable should be set to include the directories where the required tools are located.
All operating systems require the following
scp
bzip2
pg_dump
pg_dumpall
In addition, Red Hat Linux requires the following additional tool:
ps2pdf
Running the Batch Manager for the First Time
The first time you run the Batch Manager you will be prompted to enter the network address and the port number for an SMTP mail server. This server should be configured to accept messages from the host the Batch Manager is running on and handle them appropriately. Once you have entered this information, it will be saved for future use. Should you need to change these settings, you may do so by selecting "Options" from the "Tools" menu, found within the Batch Manager.
Sending Email using the Batch Manager
To send email using the Batch Manager, you must specify an SMTP mail server on the "Options" screen found under the "Tools" menu. You must also specify an SMTP port number. The standard port number for SMTP servers is port 25.
The Batch Manager also supports sending email via third-party, external SMTP servers. For example, mail servers hosted by Internet Service Providers (ISPs) would be considered third-party mail servers. If your external mail server requires authentication, simply select the "Requires Authentication" option on the "Options" screen. You will be prompted to enter the username and password your SMTP service requires for authentication. Once you have entered and saved the required information, you will be able to send email through third-party SMTP servers using the Batch Manager.
Running the Batch Manager
When the Batch Manager is started you need to specify a database to log into. The initial database must be an OpenMFG database; however, it does not necessarily have to be one that is configured to allow the Batch Manager to process jobs. After connecting to the initial database, the Batch Manager will try to log into each OpenMFG database on the server instance, using the same username and password specified for the initial connection. Once connected to a database, the Batch Manager will check the “Enable Batch Manager” option, which is set on the “Database Information” screen, found in the Master Information section of the System Module. If that option is selected, the Batch Manager will add the database to its list of enabled databases. If that option is not selected, the Batch Manager will disconnect from the database, and not process any pending jobs for the database. For convenience, and to help automate the Batch Manager startup process, there are several command line options you can use to specify login information. These options will pre-populate the login screen information with their values. If all of the options are set, then the login screen will not prompt you for any additional information and perform the login automatically. The following command line options are available:
-databaseURL=<connection URL>
Specifies the connection information that the Batch Manager should use when loading. The connection URL is in the following format: psql://severname/database[:port]. In the connection URL, the servername is the host or IP address of the server where the database is running. For example: somehost.openmfg.com. The database is the name of the actual database you want to connect to on the specified server. For example: mydb. The last option, port, is optional. If included, it must follow a colon and be a valid port number. If the port is not specified, the default port of '5432' will be used. For example, if you wanted to connect to the database 'mydb' on the server 'somehost.openmfg.com' using the default port, you would use the following connection URL: psql://somehost.openmfg.com/mydb.Similarly if you wanted to connect to the database 'dbtest' on the server '192.168.128.64' using the port 2345 you would use the following connection URL: psql://192.168.128.64/dbtest:2345.
-username=<user name>
- The user name you are using to connect to the server and database.
-passwd=<password>
- The password for the user name you specified.
-noAuth
- * This option can be used in place of the -passwd option to indicate that no password is required and to attempt the login without a password.
Running the Batch Manager as a Service
The Batch Manager may be run as a service whenever the server is booted up. In this section, we offer suggestions for how you may enable this automatic startup. However, please do not consider the suggestions offered here as a complete solution. Certain issues, such as security, are not taken into account. Furthermore, this solution has also only been tested on Red Hat Linux. No information is currently available for running the Batch Manager as a service on Mac OS X Panther. To run the Batch Manager as a service on Red Hat Linux, you will need to use the VNC server from RealVNC. An open source version of the VNC server is freely available. With the vnc-server rpm package installed on your Red Hat Linux server, you will have all the necessary tools installed to implement this solution. The first thing you need to do is install the Batch Manager and make sure it is set up and working correctly for the chosen user. We recommend that you set up an additional, separate user for the Batch Manager to run as. Once the Batch Manager is installed, you will next need to set up the VNC server for the same user you want to run the Batch Manager as. The easiest method for doing this is to log in as the user and run the following command:
vncserver :1
In this case we specified ':1' which specifies the terminal to use. As you will see, this detail will become important later. Typically ':1' will be sufficient; however, if you have other VNC server sessions set up, you may need to use a different number. For the rest of this document we will assume only one VNC server session is installed. When the 'vncserver :1' command runs, it will create a directory in the user’s home called '.vnc' and ask for a password. Once the VNC server is running, you can log in with vncviewer and check to see what it looks like before continuing. Once done, you should shut down the server with the following command:
vncserver -kill :1
Next, you should edit the xstartup file in the .vnc directory. This file is run by the VNC server program when VNC is started. It allows you to run other applications at startup. In most cases, the last line of the xstartup file reads as follows:
twm &
It is just after this line that you want to add the call to the Batch Manager. The command is very similar to the one you would use to run the Batch Manager from the command line normally. In the command, you will want to include the options to specify the database, username, and password so that the Batch Manager will start up without prompting for a login. The only additional option you will want to add is the '-geometry' option. This option is typical for most GUI enabled applications and specifies the size and location of the active window. The example below illustrates the '-geometry' option and assumes that the user <literal>admin</literal> does not have a database password (typically a bad idea):
BatchManager -geometry 300x320+10+10 -databaseURL=psql://localhost/mydb:5432 -username=admin -noAuth
To guard against unforeseen circumstances and the inevitable user who always exits from applications before logging out, you might want to wrap the Batch Manager startup command in a loop:
while true ; do # loop forever
BatchManager -databaseURL=psql://localhost/mydb:5432 -username=admin -noAuth
sleep 600 # wait 10 minutes before restarting the BatchManager if it exits
done # to guard against eating machine time if the BatchManager fails repeatedlyFinally, you should save and exit the xstartup file.
Now you will need to update the /etc/sysconfig/vncserver configuration file. If your system does not have one, then you will have to find or create one. Note that some versions of Linux store these service startup files in other directories, such as /etc/rc.d or /etc/initd.d. In this file there is a line which looks like the following:
VNCSERVERS="1:myusername"
This line may or may not be commented out with a '#' symbol. If it is, you need to uncomment it by removing that symbol and any additional spaces at the front of the line. The significance of this line is that it tells the VNC server service which servers to start up for which user at boot up. As you can see, the example above references the same server number we used earlier, along with the username separated by a colon. On your system, you should change the server number and user name to the correct values Save and exit the configuration file. Now you will need to make sure that the VNC server service is started when the system is booted. The easiest way to do this on your Red Hat Linux server is by using the 'chkconfig' command. Logged in as the administrator of the server, you would issue the following command:
chkconfig –add vncserver
At this point, the only thing left to do is start the service and make sure it is working correctly. To start the service, you should issue another administrator command:
service vncserver start
You should see a message indicating that the service was started successfully. Now log into the VNC session and check to make sure the Batch Manager is running correctly. If it is, you have successfully completed the set up. If it is not running, you will need to determine what caused it to fail and correct the problem.
Tuning Options
There are several Batch Manager tuning options you can use when starting the application from the command line. Any settings passed to the application using these options are valid only for the duration of the current Batch Manager session. Once the Batch Manager is stopped the settings will revert to the defaults--unless new options are passed.
Here is a list of the available options. They are only available when starting the Batch Manager from the command line. The GUI client does not currently support setting these options:
-refresh #
The number of seconds the BatchManager should wait before refreshing the database list (default is 86400, which is 1 hour).
-idle #
The number of seconds the BatchManager should wait to look for new jobs when no jobs were found (default is 300, which is 5 minutes).
-rest #
The number of seconds the BatchManager should wait to look for new jobs after finishing a job (default is 30 seconds).
The following are examples you might use:
batchmanager -refresh 81000
or
batchmanager -idle 200 batchmanager -refresh 81000 -idle 200
or
batchmanager -rest 10 batchmanager -refresh 81000 -idle 200 -rest 10
By adjusting the Batch Manager settings, you have the ability to tune it to match your site's needs.
What Do I Do if I Have Problems?
If you determine that you have a problem with the Batch Manager software itself, then you should contact your OpenMFG solution provider. However, if you are having problems installing or configuring the VNC server, the required tools, or a mail server, we recommend you look for support from either your operating system vendor or the particular open source community that supports the tool in question. OpenMFG will make every effort to help you isolate problems with the Batch Manager, but we cannot guarantee support beyond our own product.
Where are the xTuple Interfaces to the Batch Manager?
The Batch Manager was designed 1) to process large, resource-intensive jobs for OpenMFG and 2) to handle the outbound EDI capabilities of OpenMFG.
Whenever you see a SUBMIT button within OpenMFG, this signals the screen you are looking at has an interface to the Batch Manager.
The following list details the functional areas within OpenMFG where jobs may be submitted to the Batch Manager:
- Updating and posting of Costs
- Running MRP and MPS
- Server Maintenance (i.e., VACUUM FULL ANALYZE)
- Sending Invoices to Customers as email attachments
- Sending Invoices via FTP to Customers
- Sending Purchase Orders to Vendors as email attachments
- Printing time-phased reports in the I/M, M/S, S/A, and C/P Modules
- Updating of Item Site controls
