System information

Using scripts in Axis Camera/Video products
Axis Communications AB provides NO support for application development of any kind. The information
here is provided "as is", and there is no guarantee that any of the examples shown will work in your
particular application.
Revision 1.02 October 2002 8
3 Using scripts in Axis Camera/Video products
This document contain examples of complete scripts that can be used as they are, or after being
modified to suit your own purposes. The scripts have been written for the most common
applications. Some of these scripts require a task.list file, and these are also provided.
Scripts can be activated in several different ways:
by the Task Scheduler, which handles input from alarms and motion detection events
via Telnet
via the web server
These different methods are all described in the sections that follow.
3.1 Uploading scripts to the Camera/Video Server:
A new script or a script created by the wizard and subsequently modified must first be uploaded
to the camera/video server before it can be used. To do this, follow the instructions below:
1. Open a DOS session and open an FTP session from the path where the script file resides,
e.g.: c:\axis\scripts.
2. Open an FTP session to the camera/video server: E.g.: ftp <Server ip-address>.
3. Then type the user name: e.g. root.
4. Then type the password: e.g. pass.
5. Change to the directory where you want to store the script: e.g. cd etc/scripts.
6. Set the transfer mode to text: type ASCII.
7. Then upload the file to the server with the command: put <filename>.
8. To make a shell script file executable: type chmod 755 <filename>. If that doesn’t work,
type instead site chmod 755.
Tip: A very useful program for fetching or uploading scripts to the product is Ultra Edit. This
can be downloaded from http://www.ultraedit.com/
3.2 Running Scripts with the Task Scheduler
The Task Scheduler (i.e. utask) is used to start programs or scripts when events occur. The
scripts can be shell-scripts or PHP3-scripts, and can start the buffering of images or the
uploading of files via FTP or SMTP.
The Task Scheduler handles event detection based on date and time, alarm inputs, motion
detection, can start any task and also handles process management.
At start-up,
utask (the Task Scheduler) reads the configuration file /etc/task.list and
parses it for event entries. If the file does not exist when utask is started, then utask goes into
standby mode. When /etc/task.list has been created, or modified, a SIGUSR1 needs to be
sent to utask in order for it to re-read /etc/task.list. This can be done by issuing the
command kill -10 <utask-pid>. (The same effect is also achieved by simply restarting the
Axis Server).