In the ABillS billing system, you can configure the status check of any running programs, and configure automatic launch if any of them are not running.
For example, for tracking FreeRadius, you need to run the command:
/usr/abills/libexec/billd check_programs PROGRAMS="radiusd:/etc/init.d/radiusd start"
Where “radiusd” is the name of the program in the processes, and “/etc/init.d/radiusd start” the command to start it.
The correct names of running programs can be viewed for example by typing the command:
top
You can specify several programs at once, and for example, to make sure that the check is working, we will stop the services, manually check their status:
/etc/init.d/radiusd stop /etc/init.d/accel-ppp stop /etc/init.d/radiusd status /etc/init.d/accel-ppp status
Then execute the command:
/usr/abills/libexec/billd check_programs PROGRAMS="radiusd:/etc/init.d/radiusd start;accel-ppp:/etc/init.d/accel-ppp start;"
And make sure the services are running:
/etc/init.d/radiusd status /etc/init.d/accel-ppp status
To automatically check, add the task to /etc/crontab (the command will be executed every 5 minutes):
*/5 * * * * root /usr/abills/libexec/billd check_programs PROGRAMS="radiusd:/etc/init.d/radiusd start;accel-ppp:/etc/init.d/accel-ppp start;"
Similarly, you can set up tracking for named, mysql, etc.
When you need to really stop the service, you need to consider that the command from cron will re-launch it, so if necessary, you can temporarily comment it out.
Since when the program is launched, a message is also sent to the billing via the Events module, we will install it.
Import tables into the database:
mysql -u root --default-character-set=utf8 -D abills < /usr/abills/db/Events.sql
Open the configuration file in the text editor:
nano /usr/abills/libexec/config.pl
In the list of modules, add the module ‘Events’:
@MODULES = ( '...', 'Events', '...', );
Notifications are enabled by default for administrators and clients.
You can disable notifications for clients by adding an option:
$conf{USER_PORTAL_EVENTS_DISABLED}=1;
Each administrator can disable notifications for himself in the Profile menu by checking the “Disabled” box next to “Events”.
See also my article:
Installing and configuring the billing system ABillS