Niclas Hedam
02-23-2013, 10:54 PM
Hi
I've created a hook running on change or creation of user.
My XML looks like this, /usr/local/ispmgr/etc/ispmgr_newrelic.xml
<?xml version="1.0" encoding="UTF-8"?>
<mgrdata>
<handler name="newrelic.pl" type="cgi">
<event after="yes">user.edit</event>
<event after="yes">user.create</event>
</handler>
</mgrdata>
My perl looks like this, /usr/local/ispmgr/addon/newrelic.pl
#!/usr/bin/perl
use CGI;
my $Q = new CGI;
$note = $Q->param("note");
if ($note ne "!new_relic") {
# a user is created or changed
$name = $Q->param("name");
open(FH,">","/var/www/$name/.htaccess") or die "$!";
print FH "<IfModule mod_php5.c>\n";
print FH " php_value newrelic.appname $name\n";
print FH "</IfModule>\n";
close FH;
}
print "<?xml version=\"1.0\" encoding=\"UTF-8\"?>OK-RELIC\n<doc/>\n";
This should create or edit the a file located in /var/www/__THE CHANGED USER__/.htaccess and write a code making new relic able to track the user.
.. but it doesn't.
I can run the file myself with success, but when it comes to ISPManager, I think it isn't even running it.
What is wrong with this?? :confused:
Greetings,
Niclas Hedam
Server Administrator
I've created a hook running on change or creation of user.
My XML looks like this, /usr/local/ispmgr/etc/ispmgr_newrelic.xml
<?xml version="1.0" encoding="UTF-8"?>
<mgrdata>
<handler name="newrelic.pl" type="cgi">
<event after="yes">user.edit</event>
<event after="yes">user.create</event>
</handler>
</mgrdata>
My perl looks like this, /usr/local/ispmgr/addon/newrelic.pl
#!/usr/bin/perl
use CGI;
my $Q = new CGI;
$note = $Q->param("note");
if ($note ne "!new_relic") {
# a user is created or changed
$name = $Q->param("name");
open(FH,">","/var/www/$name/.htaccess") or die "$!";
print FH "<IfModule mod_php5.c>\n";
print FH " php_value newrelic.appname $name\n";
print FH "</IfModule>\n";
close FH;
}
print "<?xml version=\"1.0\" encoding=\"UTF-8\"?>OK-RELIC\n<doc/>\n";
This should create or edit the a file located in /var/www/__THE CHANGED USER__/.htaccess and write a code making new relic able to track the user.
.. but it doesn't.
I can run the file myself with success, but when it comes to ISPManager, I think it isn't even running it.
What is wrong with this?? :confused:
Greetings,
Niclas Hedam
Server Administrator