Page 1 of 1

command line tools

PostPosted: Thu Jul 12, 2007 9:44 am
by mcargile
I want to make a command line tool for vicidial that you would allow an admin to do things remotely without needing a path to port 80 on the web server. Basically I want to be able to perform things like an emergency stop through ssh.

Something like:
Code: Select all
#> vicidial deactivate campaign 1001
Campaign 1001 has been deactivated.
#> vicidial activate campaign 1002
Campaign 1002 has been activated.
#> vicidial deactivate list 135
List 135 has been deactivated.
#> vicidial deactivate campaign all
All Campaigns have been deactivated!


In order to do so I was wondering if
Code: Select all
UPDATE vicidial_campaigns set active='N' where campaign_id='1001';
UPDATE vicidial_lists set active='N' where list_id='135';

would suffice.

Also was wondering if people had any other useful queries.

PostPosted: Mon Jul 16, 2007 8:18 am
by mflorell
Not sure about scripts to do that stuff, usually I just do it through mysql.

I've never had SSH access without port 80 access so I guess I'm not sure what I would need to do admin. Making sure you have a valid admin user/pass would be essential in an admin CLI script that you could do things like that though.

PostPosted: Mon Jul 16, 2007 2:30 pm
by aster1
Why not use SSH tunnel instead? or just mysql command line ..

PostPosted: Mon Aug 20, 2007 11:36 am
by mcargile
When speed is of the essence I think that sshing into a box and issue one or two commands in quick succession to get the desired effect is far faster than having to create an ssh tunnel, log into a web gui, click to a bunch of web links, change a few fields, click submit, etc.

As far as mysql is concerned I do not feel like typing a number of long queries to get the effect either.

PostPosted: Wed Aug 22, 2007 9:13 am
by mflorell
Sounds fine to me, please post them to the tracker when they are done.

PostPosted: Wed Aug 22, 2007 11:12 am
by mcargile
At the rate things are going here might be a while.

PostPosted: Wed Nov 07, 2007 10:46 am
by artimus
I was thinking of something similar to this but then scratched the thought as it seemed like to much to maintain.

If vici was rewritten so that everything could be controlled by an API, then it would be simple to do this. The web page, cli, and anything else would be simple to make and maintain. However, without an api it will probably just add to the code duplication.

I would very much like a cli however :)

PostPosted: Wed Nov 07, 2007 11:04 am
by mflorell
The API is really just using MySQL to manipulate the database since everything is stored in the database.

PostPosted: Wed Nov 07, 2007 1:08 pm
by mcargile
The big thing is to create a database description so that it becomes easier to do thing like this in the future.

Some how I get the feeling this will be falling on my plate sometime in the new year.

PostPosted: Wed Nov 07, 2007 1:19 pm
by mflorell
Thank you for volunteering Mike! :)