• If you are still using CentOS 7.9, it's time to convert to Alma 8 with the free centos2alma tool by Plesk or Plesk Migrator. Please let us know your experiences or concerns in this thread:
    CentOS2Alma discussion

Yes its me, the event manager man again :P

M

MaRiOs

Guest
Ok lets get it straight,
now I'm testing the event manager uppon Physical hosting updated.

I have added a testing script with the command

/usr/local/psa/bin/update.sh <old_domain_name> <new_domain_name> <old_system_user> <new_system_user> <new_system_user_password>

the script looks like this :

#!/bin/sh

echo "--------------" >>/tmp/event_handler.log
echo Hosting Updated >>/tmp/event_handler.log
echo "--------------" >>/tmp/event_handler.log
#echo -e "Subject:psysical Hosting Update\nFrom:Server <[email protected]>\n"`cat /tmp/event_handler.log` | /usr/sbin/sendmail [email protected]

So I open the logs (cat /tmp/event_handler.log) to check and I see nothing..so...

Has anyone ever used something on Physical Hostin Update?
Do I define the update word wrong in my head and plesk?
I just go to hosting setup and change the login the pass and some info like asp support...
just to test it.
But its like the script isn't called by plesk at all.
 
Marios my friend, you are going to be the death of me yet.

Syntactically your last line is not correct. You will need to change it into 2 lines and the first line is missing the >> /tmp/event_handler.log:

echo -e "Subject:psysical Hosting Update\nFrom:Server <[email protected]>\n" >>/tmp/event_handler.log
cat /tmp/event_handler.log | /usr/sbin/sendmail [email protected]

This will put the data into the log file, then next it will email it to you. However, your Subject will not be shown since you should be using the 'mail' function instead of using sendmail directly.

Try this one:

echo -e "Subject:psysical Hosting Update\nFrom:Server <[email protected]>\n" >>/tmp/event_handler.log

mail -v -s "Physical Hosting Update" "[email protected]" < /tmp/event_handler.log

Then you will receive the email, Subject will be in the subject line, contents of event_handler.log will be the message body.

But if you really want to use sendmail directly, then do a 'man sendmail' or google info on proper commandline usage. (i'm really too tired and can barely read the monitor)
 
To be honest I use the exact same command in my other events and it works great, but thats not the importat thing.

Forget about the last command,like it doesnt exist,after all i dont trust this i just do a cat /tmp/event_handler.log to see if the event worked.

That was the point,I'm sorry of confusing you so much.

( i think by the end of this year i ll owe you a truck full of greek wine lol)
 
Ok, so now I really am confused. I'll ignore the second line. But then I guess I didn't understand the problem or question properly from your post.... I think I'll go offline now for some down time.
 
Its very simple! I just want in the event of Psysical Hostin update to run a script that will type a "HELLO" or an "Its Wokring" in a text/log file.

Just to see if it works.

If that works we will see....

get some sleep my friend we will solve it tommorow :)
 
jamesyeeoc did u test it ? :p

I just want to see if it works for u,so its not a bug.
 
Sorry for my earlier post (now deleted), it does in fact run the script (foolish me, I forgot to chmod +x the script file)

I setup a simple script to just echo the passed arguments/parameters to the log file. It did do so upon my changing even just the ftp username and nothing else.
 
so you just changed the domain's ftp pasword from psysical hosting setup and the event runned fine ?

damn...
 
Not even the ftp password, just the ftp username from 'marios' to 'marios2' and saved the changes.

Remember to do 'chmod +x scriptfilename', I had originally posted that it did not work. Then realized I had created a new script and forgot to chmod it (as I had advised you earlier). I give great advice, but am lousy at taking my own advice...

Remember, I just made a very simple script to echo the values, nothing else. As a test, it was not necessary to use the full script as outlined in above posts.

Do 'chmod +x filename' instead of 'chmod 777 filename'
 
hahhaha damn!!!
If im gonna tell you what the problem was, you will kick me in the teeth for sure!

I was about to do the chmod +x thing u said..
and then I realised that the script's extention was .ssh and not .sh ..........................

so I did a simple mv and now it works :p
Sorry man :p
 
Back
Top