US: 1-941-4621-069
  
Cyprus: 3-572-2052-781

Go Back   ISPsystem.com Forums > ISPmanager > Troubleshooting


Reply
 
Thread Tools
Old 09-24-2013, 04:21 PM   #1
Junior Member
 
Join Date: Oct 2011
Posts: 13
Patrick is on a distinguished road
Default Custom Operations not working

Hello,
I would perform some custom operations after a domain get's created or deleted.
I followed this guide:
http://en.ispdoc.com/index.php/Perfo...tom_operations

For testing i added a /usr/local/ispmgr/etc/ispmgr_mod_jetty-add.xml:
Code:
<?xml version="1.0" encoding="UTF-8"?>
  <mgrdata>
    <handler name="jetty_add.pl" type="cgi">
      <event after="yes">domain.edit</event>
    </handler>
  </mgrdata>
And added /usr/local/ispmgr/addon/jetty_add.pl:
Code:
#!/usr/bin/perl
use CGI;
my $Q = new CGI;

    system("touch /root/jetty_added");

print "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<doc/>\n";
jetty_add.pl has ben chmoded 750 and is owned by root.root

I restarted ispmgr and tried to add a domain. The domain gets created but nothing happens. No error or something, but jetty_added gets not created.

Running perl /usr/local/ispmgr/addon/jetty_add.pl creates a empty file /root/jetty_added, so the script is working. But it seems ispmgr doesn't fire it on events.

What is missing?
Patrick is offline   Reply With Quote
Old 09-25-2013, 11:01 AM   #2
ISPsystem team
 
Join Date: Jun 2013
Posts: 233
fly is on a distinguished road
Default

Hello,

Did you restart ISPmanager? ISPmanager can be restarted via command killall ispmgr

I added your xml and script to my ISPmanager and it works properly.

Sep 25 11:58:12 [30159:11] INFO Request [188.120.252.33][root] 'name=mary.me&ip=188.120.228.130&ns=ns1.mary.me.+n s2.mary.me.&ns_list=&mx=mail+mail&mx_list=&owner=m ary&func=domain.edit&elid=mary.me&sok=ok'
Sep 25 11:58:12 [30159:11] ../../src/ispmgr/core/ispmgr.cpp:746 TRACE Rebuild AccountCache force[false] pgen[1] cgen[20]
Sep 25 11:58:12 [30159:11] ../../src/ispmgr/core/ispmgr.cpp:922 DEBUG Total accounts 2
Sep 25 11:58:12 [30159:11] ../../src/mgr/core/action.cpp:421 DEBUG Execute addon 'addon/jetty_add.pl'
Sep 25 11:58:12 [30159:11] ../../src/mgr/core/session.cpp:390 DEBUG send post data 'name=mary.me&ip=188.120.228.130&ns=ns1.mary.me.+n s2.mary.me.&ns_list=&mx=mail+mail&mx_list=&owner=m ary&func=domain.edit&elid=mary.me&sok=ok'
Sep 25 11:58:12 [30159:11] ../../src/mgr/core/action.cpp:476 DEBUG return code 0 recived result '<?xml version="1.0" encoding="UTF-8"?>
fly is offline   Reply With Quote
Old 09-25-2013, 05:46 PM   #3
Junior Member
 
Join Date: Oct 2011
Posts: 13
Patrick is on a distinguished road
Default

I even rebooted the server (it's a testing machine), but no luck.
And no hints in the ispmgr logs
Patrick is offline   Reply With Quote
Old 09-26-2013, 10:09 AM   #4
ISPsystem team
 
Join Date: Jun 2013
Posts: 233
fly is on a distinguished road
Default

Please show ISPmanager's log in time you call function domain.edit.
fly is offline   Reply With Quote
Old 09-26-2013, 10:34 AM   #5
Junior Member
 
Join Date: Oct 2011
Posts: 13
Patrick is on a distinguished road
Default

Here the ispmgr.log:
Sep 26 09:28:09 [ 3108:229] INFO Request [192.168.1.10][root] 'operafake=456&plid=&func=wwwdomain%2Eedit'
Sep 26 09:28:09 [ 3108:229] INFO Internal Request 'wwwdomain.log' 'elid='
Sep 26 09:28:09 [ 3108:229] INFO Internal Request 'wwwdomain.log' 'out=xml&elid='
Sep 26 09:28:09 [ 3108:229] INFO Internal Request 'cert' ''
Sep 26 09:28:41 [ 3108:230] INFO Request [192.168.1.10][root] 'domain=example.org&alias=www.example.org&alias_li st=&docroot=auto&owner=patrick&ip=192.168.1.30&adm in=info%40example.org&charset=&index=&index_list=& autosubdomain=asdnone&php=phpnone&ssiext=&sslport= 443&cert=newcert&page_php_th=__nopage__&static_reg ex=dummy&static_ext=&static_ext_list=&accesslog=ro tated&errlog=rotated&rotper=day&size=&arcnum=10&an alyzer=none&analper=day&func=wwwdomain.edit&elid=& sok=ok'
Sep 26 09:28:41 [ 3108:230] EXTINFO Execute (/bin/cp -Rp /usr/local/ispmgr/etc/www.skel /var/www/patrick/data/www/example.org) return=0 exited
Sep 26 09:28:41 [ 3108:230] INFO Internal Request 'wwwdomain.log' 'elid=example.org&rotper=day&size=&analper=day&arc num=10&analyzer=none&errlog=rotated&accesslog=rota ted&sok=ok&out=xml'
Sep 26 09:28:41 [ 3108:230] INFO Internal Request 'diraccess.edit' 'sok=ok&name=/www/example.org/webstat&dirindex=index.html'
Sep 26 09:28:41 [ 3108:2] EXTINFO Execute (/etc/rc.d/init.d/nginx reload) return=0 exited
Sep 26 09:28:41 [ 3108:2] EXTINFO Nginx `/etc/rc.d/init.d/nginx reload` complete successful
Sep 26 09:28:42 [ 3108:230] INFO Internal Request 'diraccess.user.edit' 'sok=ok&name=patrick&plid=/www/example.org/webstat&hash=$1$Z5BawbJo$MPHfUsSuiGdV5lmmQAzpm.'
Sep 26 09:28:42 [ 3108:2] EXTINFO Execute (/etc/rc.d/init.d/nginx reload) return=0 exited
Sep 26 09:28:42 [ 3108:2] EXTINFO Nginx `/etc/rc.d/init.d/nginx reload` complete successful
Sep 26 09:28:42 [ 3108:3] EXTINFO Execute (/usr/sbin/apachectl graceful) return=0 exited
Sep 26 09:28:43 [ 3108:231] INFO Request [192.168.1.10][root] 'clickstat=yes&func=wwwdomain'
Patrick is offline   Reply With Quote
Old 09-26-2013, 12:34 PM   #6
ISPsystem team
 
Join Date: Jun 2013
Posts: 233
fly is on a distinguished road
Default

I see that toy call function wwwdomain.edit , but your custom operation runs after function domain.edit.

Function wwwdomain.edit is called when www domain is creating. Function domain.edit is called when domain name (DNS) is creating.
fly is offline   Reply With Quote
Old 09-26-2013, 12:49 PM   #7
Junior Member
 
Join Date: Oct 2011
Posts: 13
Patrick is on a distinguished road
Default

Okay, so I used wrong event. I'll give it a try. Thx.

Edit: works!

Last edited by Patrick; 09-26-2013 at 01:20 PM.
Patrick is offline   Reply With Quote
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 12:13 PM.