Topic: Ability to add a custom command when reloading [Comments: 7]
joshjacoby

Thu, 08/18/2011 - 09:55 | Ability to add a custom command when reloading

Not sure if this exists now, but it would be nice if the reload and restart functions in the GUI could perhaps execute a script file that I could edit. Initial purpose here is when I reload the system I want to execute a script to back-up the configuration files so I could potentially regress to a previous system state should the need arise. Easiest way would be to just add a quick command to the existing reload script to run my file.

eeman

Fri, 08/19/2011 - 11:03 | no, I don't think you

no, I don't think you understand what reload is or does.. because potentially there could have been 2000 different changes since the last reload. The file gets altered as soon as you click 'save' on a specific page. You could make hundreds of changes, before clicking reload. If you are using MTE there is also the automatic reloading process that runs every 15min to scan for a pending reload and you wouldn't know when your customer makes a change. There is also the question of reversion because one tenant screwed up (nothing is actually crashing asterisk or anything, he just screwed up his route) and you go and hit the rewind button, and suddenly all the work another tenant just spent time doing is wiped out.

your best option is just using the thirdlane backup utility and keep nightly backups, with the option of an immediate backup if you're really paranoid. There really should not exist the need to press the rewind button because your inbound route isnt doing what you want it to do, its simpler just to re-edit the inbound route than to restore a backup.

Erik Smith
CTO
BluegrassNet Voice
dCAP
Thirdlane Support by BluegrassNet Voice
eeman at bluegrassnetvoice dot com

joshjacoby

Fri, 08/19/2011 - 17:12 | I do actually understand the

I do actually understand the function of reload quite well, and while you make valid points, they don't answer my question of whether we can execute our own custom script at the time of reload. In our situation we don't give the tenants access to the system in the way you describe and our changes are tightly controlled. I was trying to improve our internal workflow.

eeman

Fri, 08/19/2011 - 19:25 | unfortunately no, the reload

unfortunately no, the reload event is an AMI communication, there are no hooks to allow for that.

Erik Smith
CTO
BluegrassNet Voice
dCAP
Thirdlane Support by BluegrassNet Voice
eeman at bluegrassnetvoice dot com

rfrantik

Sun, 09/18/2011 - 18:21 | Automatic Reload Question

Erik, you mention the "MTE automatic reloading", how is that supposed to work? Does it actually do the reload or just scan for the need to prompt for a reload in the GUI? We are on Asterisk v1.6.2.11 and MTE v6.1.1.12. I don't see it doing an actual reload, so I'm assuming it's just prompting.

As a followup. I've got the MTE set to do a cron reload at 1am using the following command:

>asterisk -rx "reload"

It looks like the the CLI reload doesn't clear the prompt in the GUI. Is there a way to do this?

mattdarnell
rfrantik

Mon, 09/19/2011 - 14:50 | Thanks

Yes, that thread had the info I was looking for... for anyone else that finds this...

Any time the MTE updates data that needs a reload it writes this file out to the drive, /etc/webmin/asterisk/reload_default. This file doesn't appear to contain any data, but is just an indicator that a reload is necessary. If this file exists, the "reload" button appears on the webpage. The manual reload

asterisk -rx "reload"

doesn't clear this file, so we issue a remove command to clear the file and remove the button via the cron script.

rm /etc/webmin/asterisk/reload_default

moshe

Fri, 09/23/2011 - 04:08 | @rfrantik just a thought you

@rfrantik just a thought you might use the same cron job that executes the reload to run your script followed by the reload