This is the new home of the egghelp.org community forum.
All data has been migrated (including user logins/passwords) to a new phpBB version.


For more information, see this announcement post. Click the X in the top right-corner of this box to dismiss this message.

Problem with pisg-0.5.tcl

Old posts that have not been replied to for several years.
Locked
C
CrimsonDawn
Voice
Posts: 8
Joined: Sun Jul 18, 2004 12:40 am
Location: New York

Problem with pisg-0.5.tcl

Post by CrimsonDawn »

Hi all. Before I start with the problem, I figured I would get this little bit out of the way. I'm a n00b when it comes to TCL. I can muck around inside scripts (and only easy ones, mind you), but anything more than that is a bit over my head. I do, however, follow instruction well, so I dont think I should cause you much trouble :) With that said, here's the problem I'm facing:

I'm hosting an eggdrop on my computer for a friend and using pisg 0.56 to generate nice stats for it, which works great. As far as I know, everything is configured correctly because I can view the generated stats (by both calling pisg and running the public egg trigger), however, the script does not upload the generated stats page to my remote server, as it says it should.

Now, I did modify the script a bit because I wanted the generated file to read as index.html, rather than channel.html, but I don't know if I did that correctly. Below is the (very small) section of the pisg config file, as well as the ftp info and the section I changed. Any help would be greatly appreciated.

pisg.cfg:

Code: Select all

<channel="#|ronin|">
 LogDir="/home/crimson/MrRoboto/logs/ronin/"
 Format="eggdrop"
 OutputFile="/home/crimson/public_html/index.html"
</channel>
pisg-0.5.tcl (ftp info)

Code: Select all

# ftp configuration
# pisg_useftp is either 1 or .. it's off.
# pisg_localdir should be a full path, without trailing /
set pisg_useftp "1"
set pisg_server "ftp.mythosa.com"
set pisg_user "******"
set pisg_pass "******"
set pisg_localdir "/home/crimson/public_html"
set pisg_remotedir "/home/mythosa/public_html/ronin"
pisg-0.5.tcl (section I changed for the file output)

Code: Select all

# used for auto-creation and public !pisg messages
proc pisg_stats {min hour day month year} {
  global pisgpath pisgconfig pisgchan
  global pisg_localdir pisg_remotedir pisg_server pisg_user pisg_pass pisgversion pisg_useftp pisg_automsg pisg_url
  putlog "pisg-$pisgversion: Channel Stats Generating.. please wait."
  exec $pisgpath -co $pisgconfig
  foreach pisgc [string tolower $pisgchan] {
    set pisg_filename "index.html" (index.html originally read $pisgchan)
    set pisg_newurl "$pisg_url/$pisg_filename"
    if {$pisg_useftp == 1} {
      set pisg_localfile "$pisg_localdir/$pisg_filename"
      set pisg_remotefile "$pisg_remotedir/$pisg_filename"
      pisg_sendftp $pisg_localfile $pisg_server $pisg_user $pisg_pass $pisg_remotefile
    }
    puthelp "PRIVMSG \#$pisgc :$pisg_automsg $pisg_newurl"
  }
}
I promise that I did as exhaustive a search as I could on the forums here, but havent been able to come up with anything. The little section I changed outputs the stats to index.html correctly, but does not upload correctly through the script. I can manually upload the file running /usr/bin/ftp, so I'm stumped. Also, I have installed TCLlib 1.6.1 as per a suggestion I found elsewhere on the forum, but that didn't seem to help any.

I'm sorry for the long post, but I tried to give as much info as I could. Thanks again for the help, and the time :D

Regards,
~C
User avatar
Alchera
Revered One
Posts: 3344
Joined: Mon Aug 11, 2003 12:42 pm
Location: Ballarat Victoria, Australia
Contact:

Post by Alchera »

I use pisg v0.56 on one of my bots' shells so I don't have a need to FTP anything anywhere.

Your configuration settings:

Code: Select all

<channel="#|ronin|"> 
 LogDir="/home/crimson/MrRoboto/logs/ronin/" 
 Format="eggdrop" 
 OutputFile="/home/crimson/public_html/index.html" 
</channel>
You could add Network= & Maintainer=

As for the section you altered, no need as everything is set in the pisg configuration file. You already set the file output via the "OutputFile=" setting.

I suggest you restore the original pisg file (you altered) and change all settings via the configuration file only!

In the bots' configuration file you may need the transfer module enabled.
Add [SOLVED] to the thread title if your issue has been.
Search | FAQ | RTM
C
CrimsonDawn
Voice
Posts: 8
Joined: Sun Jul 18, 2004 12:40 am
Location: New York

Post by CrimsonDawn »

Hey Alchera, thanks for the reply. My config settings for pisg are a lot more detailed than that. I only posted the info that was important to pisg-0.5.tcl (mainly the log directory and the output file). I have plenty more options configured inside there, as well as plenty of users defined. I didn't want to post more because it would have only stretched this already long post further :)

The section I changed inside pisg-0.5.tcl (third code snip) was changed because the script itself was trying to force pisg to output the stats file in for form of channel.html, which was conflicting with the pisg.cfg. So changing from $pisgchan to index.html made pisg happy. The reason I wanted it as index.html was so I could just stick it up on a subdomain, this way people dont have to fumble with remembering the URL including the filename (some of the people on the channel aren't the sharpest tools in the shed :D).

Even when I had everything set as the default (only changing what needed to be changed, like the FTP settings), and I had pisg configured to output the file as the channel name instead, it still wouldn't upload. I just tried it again before replying, and no dice. I am honestly stumped.

As for the actual egg configuration, I do have the transfer module enabled (which I found on another thread as a suggestion for getting FTP's to upload, but I forgot to mention it in my first post). I also have all my permissions set correctly, but it just refuses to upload. I'm going to try setting everything back to the default settings again, and giving it another shot.

Thanks again for the help, Alchera!! :)

~C
User avatar
Alchera
Revered One
Posts: 3344
Joined: Mon Aug 11, 2003 12:42 pm
Location: Ballarat Victoria, Australia
Contact:

Post by Alchera »

Hmmm.. have just realised that you're using a "front end" for pisg. I use the stand alone pisg by Morten Brix Pedersen which is not loaded by eggdrop! Which is why I have never had to do anything outside of pisg.cfg.

As for the Sendftp v1.01 bit, do you have the "ftp" tool available? Do "/usr/bin/ftp" or "/bin/ftp" even exist?

Are there errors generated in your bots' logs?
Add [SOLVED] to the thread title if your issue has been.
Search | FAQ | RTM
C
CrimsonDawn
Voice
Posts: 8
Joined: Sun Jul 18, 2004 12:40 am
Location: New York

Post by CrimsonDawn »

Hi again, Alchera. I guess you could classify this as a front end, even though it is only using a public command to call the pisg prog (which I have set up in my /scripts/pisg folder to keep everything somewhat together...haven't tried changing the location of the output file...that might be a problem...) and upload it.

I do have the ftp tool available. I can call it via the console either using ftp <address> or /usr/bin/ftp which brings up the ftp prompt. As for errors in the egg logs, absolutely none. When the script is called, I see this in the partyline: "pisg-0.56: Channel Stats Generating...please wait." Once that finishes, it broadcasts this message to the channel: "Channel Stats Automatically Updated :: http://ronin.mythosa.com/index.html" however, when matching up the file from the computer to the one I'm FTPing to, it isnt new at all, but the one I had to manually upload.

Like I said, I'm totally stumped. I tried setting everything back to defaults, but no luck there. I'll try setting the output file from pisg to a different directory (maybe just in the /scripts/pisg folder) and I'll see if that makes a difference, but I dont think it should.

Perhaps using cron would be easier, setting it to call pisg and ftp the output every 30 mins or so, but that's above and beyond my ability.

Thanks again for the help, Alchera. I do appreciate it :)

Regards,
~C
User avatar
Alchera
Revered One
Posts: 3344
Joined: Mon Aug 11, 2003 12:42 pm
Location: Ballarat Victoria, Australia
Contact:

Post by Alchera »

For crontab create a file called "pisgchek" and chmod it 755.

Here is the content of my file:

Code: Select all

#!/bin/sh

statsbin="./pisg"
statpath="/home/Ballarat/public_html/pisg-0.52"

cd $statpath

$statsbin
And here is my crontab entry:

Code: Select all

0,30 * * * * ~/public_html/pisg-0.52/pisgchek >/dev/null 2>&1
For some reason (that I cannot remember) I have pisg sitting in "pisg-0.52" but that's irrelevant. LOL

Crontab updates my stats page every 30 minutes on the hour. You should be easily able to set up a crontab for FTP with little effort also.

One more question: After the bot has "seemingly" uploaded index.html error free and you have gone to the site, does CTRL+F5 (Internet Explorer) display the updated page?

For all intents and purposes, from what you have posted, it appears that what you want done is actually being done. You could also try contacting the author of the TCL and see where that leads to. :)
Add [SOLVED] to the thread title if your issue has been.
Search | FAQ | RTM
C
CrimsonDawn
Voice
Posts: 8
Joined: Sun Jul 18, 2004 12:40 am
Location: New York

Post by CrimsonDawn »

Hi once again, Alchera :D

After the bot claims that it uploaded the index.html file, going to the site show the old, manually uploaded file, even after countless refreshing (and note, that I have my cache disabled in IE and Firefox, the 2 browsers I use most), so your guess is as good as mine there. You're right about the script appearing like it is working, but it just isnt. It could just be one of those cases that remains a mystery, heh. I'll get in touch with the author of the script, because this one says it was written for pisg 0.5, not sure if it's forward compatable (though I dont see why it wouldnt be...stats generate, though nothing uploads), so we'll see where that leads.

Thanks for the crontab settings. I think that is the road I will go unless this script magically starts working :D I'll figger out the FTP part through trial and error (good way to learn, after all).

Again, I have to thank you for the help and the time. Much obliged :D

~C
User avatar
Alchera
Revered One
Posts: 3344
Joined: Mon Aug 11, 2003 12:42 pm
Location: Ballarat Victoria, Australia
Contact:

Post by Alchera »

Sorry I wasn't able to be of more help. I cannot see if there would be a problem using a later version of pisg with that script as pisg.cfg was unchanged from previous version to current. The new version was code work fixing a few minor bugs.

Good luck with it. :)
Add [SOLVED] to the thread title if your issue has been.
Search | FAQ | RTM
C
CrimsonDawn
Voice
Posts: 8
Joined: Sun Jul 18, 2004 12:40 am
Location: New York

Post by CrimsonDawn »

Alchera wrote:Sorry I wasn't able to be of more help.
Don't be silly, Alchera. You were plenty of help :D I managed to get everything working via cron jobs and everyone is happy. Thank's again for everything. :)

Regards,
~C
User avatar
Alchera
Revered One
Posts: 3344
Joined: Mon Aug 11, 2003 12:42 pm
Location: Ballarat Victoria, Australia
Contact:

Post by Alchera »

* Alchera Polishes his halo LOL

I'm glad it all worked out for you. :D
Add [SOLVED] to the thread title if your issue has been.
Search | FAQ | RTM
Locked