aMule Forum

Please login or register.

Login with username, password and session length
Advanced search  

News:

We're back! (IN POG FORM)

Author Topic: Tips for the 'Events' page in the wiki  (Read 3625 times)

raffe1234

  • Approved Newbie
  • *
  • Karma: 0
  • Offline Offline
  • Posts: 14
Tips for the 'Events' page in the wiki
« on: August 13, 2017, 01:41:24 PM »

Hi!

Under http://wiki.amule.org/wiki/Events#Linux I would move the citation mark from
if [ ! -z "$DLtime" ] ; then echo "Active download time:" $DLtime ; fi
to
if [ ! -z "$DLtime" ] ; then echo "Active download time: $DLtime" ; fi
If it says "hours" or "minutes" you will then also get that text. E.g. instead of it only saying "9:13" it will say "9:13 hours" or maybe "9:13 mins"

Maybe also even more tips on making the script give more info about the system. Some examples to add:
echo " "
echo "--------------------------------------------------------------------"
echo "-==============================-"
echo "-=======-  NAS status -========-"
echo "-==============================-"
echo " "
echo "=== Uptime:"
uptime
echo " "
echo "=== User status:"
user_status show_all
echo " "
echo "=== Disk usage:"
df -h
echo " "
echo "=== aMule processes:"
ps | grep 'PID\|aMule'
echo " "
echo "=== Top processes:"
top -n 1
echo " "
echo "=== Memory:"
free
echo " "
echo "=== Route:"
route
echo " "
echo "=== IP numbers"
echo "$(ifconfig | grep inet | sed -r 's/^.{10}//')"
echo " "
echo "=== Default gateways"
route | grep default
echo " "
echo "=== DNS serves"
cat /etc/resolv.conf
echo " "
echo "=== Iptables:"
iptables -S
And maybe more cool stuff you here come up with :-)
« Last Edit: August 13, 2017, 04:03:27 PM by raffe1234 »
Logged

raffe1234

  • Approved Newbie
  • *
  • Karma: 0
  • Offline Offline
  • Posts: 14
Re: Tips for the 'Events' page in the wiki
« Reply #1 on: August 14, 2017, 03:38:49 PM »

Also, one more tip to the wiki. If you start the email part like this

...
...
{
echo To: name@somewhere.com
echo Subject: "$NameShort"
echo " "
# Mail header
echo "MIME-Version: 1.0"
echo "Content-Type: text/html"
echo "Content-Disposition: inline"
echo "<html>"
echo "<body>"
echo "<pre style="font: monospace">"
# Mail body
echo aMule completed this download:
echo ------------------------------

...
...

And end it like this

...
...
echo " "
echo --------------------------------------------------------------------
# Mail footer
echo "</pre>"
echo "</body>"
echo "</html>"
} | sendmail -t


The email will then be in html format and echo "<pre style="font: monospace">" will format the text so it will look nice.

So instead of the text looking like this:

=== Disk usage:
Filesystem                Size      Used Available Use% Mounted on
none                    250.0M    194.1M     55.9M  78% /
devtmpfs                  1.9G      4.0K      1.9G   0% /dev
tmpfs                    64.0M    376.0K     63.6M   1% /tmp
tmpfs                     1.9G     12.0K      1.9G   0% /dev/shm
tmpfs                    16.0M         0     16.0M   0% /share
tmpfs                    16.0M         0     16.0M   0% /share/snapshot/export
/dev/md9                493.5M    121.1M    372.3M  25% /mnt/HDA_ROOT


It will look like this

=== Disk usage:
Filesystem                Size      Used Available Use% Mounted on
none                    250.0M    194.1M     55.9M  78% /
devtmpfs                  1.9G      4.0K      1.9G   0% /dev
tmpfs                    64.0M    376.0K     63.6M   1% /tmp
tmpfs                     1.9G     12.0K      1.9G   0% /dev/shm
tmpfs                    16.0M         0     16.0M   0% /share
tmpfs                    16.0M         0     16.0M   0% /share/snapshot/export
/dev/md9                493.5M    121.1M    372.3M  25% /mnt/HDA_ROOT

Logged

GonoszTopi

  • The current man in charge of most things.
  • Administrator
  • Hero Member
  • *****
  • Karma: 169
  • Offline Offline
  • Posts: 2685
Re: Tips for the 'Events' page in the wiki
« Reply #2 on: August 25, 2017, 04:23:27 PM »

Please PM me your desired wiki account name and email address, and I will create a wiki account for you. Thus you'll be able to make the desired changes in the wiki yourself.
Logged
concordia cum veritate

raffe1234

  • Approved Newbie
  • *
  • Karma: 0
  • Offline Offline
  • Posts: 14
Re: Tips for the 'Events' page in the wiki
« Reply #3 on: October 10, 2017, 02:46:45 PM »

Please PM me your desired wiki account name and email address, and I will create a wiki account for you. Thus you'll be able to make the desired changes in the wiki yourself.
Done my changes :-)
Logged