A short list of the more useful 900+ ipkg packages

From SynologyWiki

Jump to: navigation, search

This wiki page contains a list of the ipkg packages recomended by the synology "modders community". Just to make it perfectly clear, modding is NOT recomended by Synology, however Synology do recognise there is a large community of people who do modify their synology servers.

The list below is HARDWARE INDEPENDANT! It focus's on listing the ipkg packages that are regularly used, whatever the hardware platform. Obviously as detailed in Overview on modifying the Synology Server, bootstrap, ipkg etc if you decide to install an ipkg package you will need to get the compatible version. But this wiki page is aimed at getting you started on what packages might be useful to you.

For many of the packages listed below there are other wiki pages (some hardware specific) giving details such as how to install, how to use, and links to pre-compiled binaries.


Contents

What is an ipkg package

For the answer to this see the section on ipkg in Overview on modifying the Synology Server, bootstrap, ipkg etc


How do I install ipkg

For the answer to this see the section on ipkg in Overview on modifying the Synology Server, bootstrap, ipkg etc


How do I run an installed ipkg package

Normally you just enter name of the package at the command line, e.g. for MC enter "mc". However, due to security restrictions the installed packages (including ipkg itself) cannot be run whilst cd'd within a volume1 sub directory. So if you get the response "-ash: xxxx: not found" where xxxx is name of the program you are trying to run enter the command "cd /" and then the name of the package you want to run.

Most programs/packages have some form of help which you can see by using the command "xxxx --help" where xxxx is the name of the program/package.

The List

coreutils

There are a very many useful tools in this package;

  1. Shred - This programs shreds data on devices and of files/directories for those that are security conscious. It can also be used as a faster way to prepare hardisks than the dd command

To install coreutils you need to have ipkg installed (see above), then use "ipkg install coreutils", use "shred --help" for info on shred

Midnight Commander (MC)

MC is a two-pane text based file manager. You can run shell commands from within it (with restrictions), use its own file contents viewer (ascii and HEX, line wrap, unwrap, support), use its text editior (much more friendly than vi!). Once used to using MC you will will be able to move around and carry out command line environment type work much quicker and easier than is possible with just using the bare Command Line envirmonment. To install MC you need to have ipkg installed (see above), then use "ipkg install mc". Run MC using the command "mc".

MC has its own built in help. For more info on MC see http://www.ibiblio.org/mc/

nail

nail is a command line email client. This means it can send emails via an email server, you need to have an email server for nail to use, e.g. could be your own hosted email server, or any email account such as yahoo, gmail, and millions of others. Nail is very simple to configure and use and is therefore ideal if you want your scripts to send you an email, e.g. email you a log file or the result of a cronjob or anything else. For full info on nail see http://linux.die.net/man/1/nail, for a short guide see http://www.linux.com/articles/51767

If you want your NAS to be an email server you will need to use something like "sendmail".

To install nail you need to have ipkg installed (see above), then use "ipkg install nail". To use nail you need to have an email provider (yahoo gmail etc.) or your own domain hosting with email imap/pop boxes. It is recomended (but not neccessary) that you create an email account just for the NAS to use, e.g. MyNAS@MyDomain.com or MyNAS@yahoo.com which the NAS can then use to send you (and/or others) emails. To configure nail edit the file "/opt/etc/nail.rc" and make the following changes;

1. Comment out the line "set hold"

2. Add to the end of the file the lines below (this sets the default mail account);

set folder=pop3://MyNAS@MyDomain.com #Note: if not pop3 you can use imaps, imap, and pop3s
set smtp=smtp://mail.MyDomain.com
set from="MyNAS@MyDomain.com"
set smtp-auth=login
set smtp-auth-user=MyNas #Note: for some email providers you need to put pop.MyNAS
set smtp-auth-password=MyPassword

3. Repeat the lines below at the end of the file for any additional email accounts you want

account ashortnameforyouraccount {
set folder=pop3://MyNAS@MyDomain.com #Note: if not pop3 you can use imaps, imap, and pop3s
set smtp=smtp://mail.MyDomain.com
set from="MyNAS@MyDomain.com"
set smtp-auth=login
set smtp-auth-user=MyNas #Note: for some email providers you need to put pop.MyNAS
set smtp-auth-password=MyPassword
}

To use the default account in a script without an attachment use a command like;

echo "Put your message text here" | /opt/bin/nail -s "Put Your message subject here" TheRecipient@TheRecipientsDomain.com

To use another account in a script without an attachment use a command like;

echo "Put your message text here" | /opt/bin/nail -A theshortnameforyouraccount -s "Put Your message subject here" TheRecipient@TheRecipientsDomain.com

To use the default account in a script with an attachment use a command like;

echo "Put your message text here" | /opt/bin/nail -s "Put Your message subject here" -a /var/logs/mylogfile.txt TheRecipient@TheRecipientsDomain.com

To use another account add the option "-A theshortnameforyouraccount" to the command line.

If for any reason nail was unable to send the email message (e.g. your isp was down, your email provider was down, etc) nail creates a file "/root/dead.letter". To automate the task of sending a message, checking it was sent ok and if not resending you could use a script like the one below.


#!/bin/sh
#This script sends an email from the default email account and then checks it was sent ok. If not it tries to resend the email.

#send the email
var_subject="put your email subject here"
var_content="put your email body text here"

echo "$var_content" | /opt/bin/nail -s "$var_subject" TheRecipient@TheRecipientsDomain.com

#if the email fails nail will create a file dead.letter, test to see if it exists and if so wait 10minutes and then resend

while ls "/root/dead.letter"
    do
      echo email failed - waiting 10 minutes and then re-sending
      sleep 600
      rm "/root/dead.letter"
      echo "$var_content" | /opt/bin/nail -s "$var_subject" TheRecipient@TheRecipientsDomain.com
      sleep 10
done

screen

Amongst many features screen has two very useful features for the synology user.

  1. Screen enables you to run multiple command shells on the one box so you can run multiple tasks from the Command Line Interface symultaneously.
  2. Screen enables the command shell(s) of the Command Line Interface to continue running even if you disconnect or terminate the Command Line Interface connection to the Synology Server.

To install screen you need to have ipkg installed (see above), then use "ipkg install screen" and to run use "screen". Alternatively as screen has no dependants other than those already installed on the synology server, you can just copy the appropriate screen binary file to a directory in your synology server and run it from there using the "TERM=vt102" commmand followed by "./screen" command.

See the man page for instructions on how to use screenhttp://www.linuxmanpages.com/man1/screen.1.php

Smartmontools

NOTE: The ability to read/write Hard Disk S.M.A.R.T. parameters was introduced with FW 702. If you have FW 702 or above you do not need this mod as you can access the S.M.A.R.T. data via the NAS Management GUI.

This package enables you to manage the S.M.A.R.T. fuctionality of S.M.A.R.T. disk drives installed in your Synology Server. Using it you can view a disk drives health data (e.g. number of bad sectors, number power cycles, number of read errors, average seek times, etc. etc.) and get a drive to initiate self tests. Obviously this software will only work if your drive supports S.M.A.R.T. Virtually all new drives do and many leading brands have manufactured S.M.A.R.T. drives for many years now.

  • To install smartmontools you need to have ipkg installed (see above), then use the command "ipkg install smartmontools".
  • When using smartmontools you will need to refer to the hard disk you want smartmontools to use. This differs between singlebay NAS models which can only have one disk in them (e.g. DS106, DS107 etc) and multibay models (even if you only have one disk in them).
    • For single bay models the hard disk is refered to as /dev/hda.
    • For multi-bay models disk1 is /dev/sda, disk2 is /dev/sdb, disk3 is /dev/sdc etc.
  • When using smartmontools you will also need to tell it the type of disk controller your NAS uses. This also differs between singlebay NAS models which can only have one disk in them (e.g. DS106, DS107 etc) and multibay models (even if you only have one disk in them).
    • For single bay models the disk controller is an ATA type, hence the start of the command line would be "smartctl -d ata ........"
    • For multi-bay models the disk controller is a "Marvell" type, hence the start of the command line would be "smartctl -d marvell ........"

The instructions below assume disk1 of a multibay NAS i.e. /dev/sda using command line starting "smartctl -d marvell". You will need to replace these with the appropriate names for your disk controller type and disk

  • Most drives are supplied with their S.M.A.R.T. functionality enabled, but if yours isn't to enable the S.M.A.R.T. functionality of a S.M.A.R.T. drive use the command "smartctl -d marvell --smart=on /dev/sda" (for single bay NAS's this would be "smartctl -d ata --smart=on /dev/hda"). This command is only neccessary once, the S.M.A.R.T. specification requires a drive to maintain its S.M.A.R.T. status through power cycling.
  • To get health info on a drive use the command "smartctl -d marvell --all /dev/sda" (for single bay NAS's this would be "smartctl -d ata --all /dev/hda")
  • To get the drive to perform a short conveyance test (if supported is approx. 5 minutes) which operates in the background and will therefore not cause a drive to drop out of an array and won't destroy your data (unless it detects a fault) use the command "smartctl -d marvell -t conveyance /dev/sda" (for single bay NAS's this would be "smartctl -d ata -t conveyance /dev/hda")
  • To get the drive to perform a short self test (approx. 5 minutes) which operates in the background and will therefore not cause a drive to drop out of an array and won't destroy your data(unless it detects a fault) use the command "smartctl -d marvell -t short /dev/sda" (for single bay NAS's this would be "smartctl -d ata -t short /dev/hda")
  • To get the drive to perform a long self test (could be several hours and includes a full surface scan) which operates in the background and will therefore not cause a drive to drop out of an array and won't destroy your data (unless it detects a fault) use the command "smartctl -d marvell -t long /dev/sda" (for single bay NAS's this would be "smartctl -d ata -t long /dev/hda")
  • To see the results of the S.M.A.R.T. test use the command "smartctl -d marvell -l selftest /dev/sda" (for single bay NAS's this would be "smartctl -d ata -l selftest /dev/hda")

To understand the information smartmontools produces see this page http://en.wikipedia.org/wiki/S.M.A.R.T.

To understand all the things you can do with smartmontools see http://smartmontools.sourceforge.net

Squid

Squid is possibly one of the most popular open source cacheing proxy servers. It is very powerful, but it is very complicated to set-up. If you just want a simple no setup required non cacheing proxy use phproxy at http://sourceforge.net/projects/poxy/). Re squid;

  • To install squid you need to have ipkg installed (see above), then use the command "ipkg install squid" (that's the last easy bit!)
  • To configure edit the squid.conf file, i.e. with vi use "vi /opt/etc/squid/squid.conf".
    • You will need to set the "visible_hostname" parameter, i.e. find the line "# TAG: visible_hostname" and change it to "visible_hostname yourname" where yourname could be anything you want displayed.
    • Could someone please add the other steps...

syslog-ng

Installing syslog-ng will enable you to do several things including: a) turn your NAS into a SysLog Server so it will log system messages from other network devices (e.g. a router or firewall) see How to make your NAS a SYSLOG Server, and b) forward your NAS' own System Messages onto a networked SysLog server.

vnstat

vnstat is a simple but effective network traffic monitor. It is not a sniffer, and does not monitor traffic at IP address or port level, but it will monitor and produce reports of the network traffic received and transmitted through the Synology Servers Network adapter. Note: Due to the way vnstat works it only records network traffic between instances of when it was asked to update the database. The instances cannot be any larger than 1 hour appart otherwise vnstat doesn't work (records will show 0bytes). Consequently you either run it manually either side of doing a network task where you want to monitor how much network traffic the task used (e.g. a specific WAN/LAN data transfer), or you set up a cron job to call "vnstat -u" atleast hourly. However the hard disks will be woken up if they were hibernating to do every database update. Therefore automatic hourly use of vnstat database update should only be used on boxes where you are happy for the disks to always be spinning.

To install vnstat you need to have ipkg installed (see above), then use "ipkg install vnstat". Before being able to use vnstat you need to create its database using the command "vnstat -u -i eth0". To display sumary data use the commands "vnstat -u" followed by "vnstat". There is much more data available, see http://humdi.net/vnstat/

There is also a php web front end for vnstat available at http://freshmeat.net/projects/vnstatfrontend/. It works well but has a limitation in database file size. Consequently after vnstat has been running hourly for about 4 months the php front end won't be able to cope with the large file and will throw up an error. If you want to continue to use the php frontend you will need to delete the vnstat database file "/opt/var/lib/vnstat/eth0" and recreate the database as described above.

To install the php web front end:

  1. Install and initiate vnstat as described above
  2. Change to the web folder, i.e. enter the command "cd /volume1/web"
  3. Get the .tar.gz file, e.g. "wget http://freshmeat.net/redir/vnstatfrontend/68867/url_tgz/vnstat_php_frontend-1.4.tar.gz"
  4. Expand the archive, e.g. "tar xvzf vnstat_php_frontend-1.4.tar.gz"
  5. Delete the archive file, e.g. "rm vnstat_php_frontend-1.4.tar.gz"
  6. Change to the new directory, e.g. "cd vnstat_php_frontend-1.4"
  7. Edit config.php using command "vi config.php" and change the variable $iface_list so that the line is "$iface_list = array('eth0');". Delete the 2 lines "$iface_title['eth1'] = 'Internet';" and "$iface_title['sixxs'] = 'SixXS IPv6';". If you want you can change the friendly name for $iface_title['eth0']. Do not change the definition of variable $vnstat_bin, this must be left blank because the php script that calls vnstat uses a "\" which is not allowed by the php service in safe mode. Consequently we have to set up a cronjob to dump the vnstat data in to the "dumps" directory defined in variable $data_dir.
  8. Make the directory dumps, i.e. "mkdir dumps"
  9. Now we need to make a script and cronjob to update the nvstat data and create the dumpfile. Make the directory /volume1/my_scripts, e.g. "mkdir /volume1/my_scripts"
  10. Create a script file for cronjob to run, i.e. "vi vnstatdump.sh" and paste the folowing iines into it "#!/bin/bash", "/opt/bin/vnstat -u", "sleep 10", "/opt/bin/vnstat --dumpdb -i eth0 >> /volume1/web/vnstat_php_frontend-1.4/dumps/vnstat_dump_eth0". Save the changes and close vi, i.e. [ESC] then ZZ
  11. Test the script, i.e. "sh vnstatdump.sh", there shouldn't be any error messages.
  12. Create the cronjob schedule, i.e. "vi /etc/crontab" and enter new lines for however frequently you want the web page data to be updated. For instance to have it updated every hour at 1 minute past the hour enter a line "1 * * * * root /volume1/my_scripts/vnstatdump.sh". Save the file and quite vi.
  13. Restart crond, i.e. "crond restart"
  14. Use your internet browser and open the index.php page, e.g http://xxx.xxx.xxx.xxx/vnstat_php_frontend-1.4/index.php

Remember the data for the web front end is only updated when the cronjob runs or if you manually run the sh script. If you want to be reminded of this everytime you view the web page you can modify the text in the file index.php on line 103, e.g. "write_data_table('Summary (All data only updated at 1 minute past the hour!)', $sum);"

Personal tools