1. Please take a little time for this simple survey! Thank you for participating!
    Dismiss Notice

Yes its me, the event manager man again :P

Discussion in 'Plesk for Linux - 8.x and Older' started by MaRiOs, Sep 5, 2005.

  1. MaRiOs

    MaRiOs Guest

    0
     
    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 <non-reply@tophost.gr>\n"`cat /tmp/event_handler.log` | /usr/sbin/sendmail m.maravelias@tophost.gr

    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.
     
  2. jamesyeeoc

    jamesyeeoc Guest

    0
     
    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 <non-reply@tophost.gr>\n" >>/tmp/event_handler.log
    cat /tmp/event_handler.log | /usr/sbin/sendmail m.maravelias@tophost.gr

    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 <non-reply@tophost.gr>\n" >>/tmp/event_handler.log

    mail -v -s "Physical Hosting Update" "m.maravelias@tophost.gr" < /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)
     
  3. MaRiOs

    MaRiOs Guest

    0
     
    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)
     
  4. jamesyeeoc

    jamesyeeoc Guest

    0
     
    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.
     
  5. MaRiOs

    MaRiOs Guest

    0
     
    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 :)
     
  6. jamesyeeoc

    jamesyeeoc Guest

    0
     
    Did you remember to 'chmod +x <nameofscript>' ?
     
  7. MaRiOs

    MaRiOs Guest

    0
     
    yes 777
     
  8. MaRiOs

    MaRiOs Guest

    0
     
    i mean chmod 777 filename
     
  9. MaRiOs

    MaRiOs Guest

    0
     
    jamesyeeoc did u test it ? :p

    I just want to see if it works for u,so its not a bug.
     
  10. jamesyeeoc

    jamesyeeoc Guest

    0
     
    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.
     
  11. MaRiOs

    MaRiOs Guest

    0
     
    so you just changed the domain's ftp pasword from psysical hosting setup and the event runned fine ?

    damn...
     
  12. jamesyeeoc

    jamesyeeoc Guest

    0
     
    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'
     
  13. MaRiOs

    MaRiOs Guest

    0
     
    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
     
Loading...