Page 5 of 10 FirstFirst ... 34567 ... LastLast
Results 41 to 50 of 96

Thread: Step by step guide to setting up Ubuntu 11.10 server for Newbies!

  1. #41
    Join Date
    Sep 2007
    Beans
    75

    Re: Step by step guide to setting up Ubuntu 11.10 server for Newbies!

    Quote Originally Posted by incindre View Post
    Hiya BVZ,

    Great post, I was completely lost without it!
    I ran into some difficulties during the setup of the RAID Array. I'm trying to create RAID10 and simply substituted 'level 5' for 'level 10' during the setup. It wouldn't mount to any mount point I created. I installed Webmin, deleted the array and rebuilt (using webmin) and I'm all sweet now (or so I hope).
    I'm now setting up the systems to monitor the health of the server and was wondering what the point of your 'Hourly' 'Daily' 'Weekly' scripts are, and if they are of any great importance. I've followed your instructions to the letter (and triple checked that my email address is spelled correctly) but when I test any of the scripts in the ~/ directory it sends no email and states "line 3: mail: command not found" (MDADM reporting to the same Gmail address is working fine however).

    I'm a Ubuntu novice using Server 12.04, could someone shed some light on this?
    Hey incindre,

    Sorry for the delay in getting back to you. I really only have time on the weekends now to look into this stuff (work and volunteering is getting out of hand).

    I'm glad you managed to get your raid set up. I haven't tried Webmin, but it sounds pretty cool.

    The hourly etc. scripts are not super important. They are simply scripts that get launched once an hour, day, or week (depending on the script) that launch other scripts. The idea was as follows:

    create four directories (continuous, hourly, daily, weekly).

    create four scripts (continuous, hourly, daily, weekly).

    These four scripts would be called by cron on an continuous, hourly, daily, weekly basis (respectively). Each of these scripts does just one thing, it looks into its associated directory and runs any scripts it may find in that directory. If there are no scripts in the directory, it does nothing and then goes back into hibernation till the next time it is called.

    All the actual work is done by the scripts that you drop into each of these directories. The idea was that makes it easier to just write a script (should you need a script to do something on a repetitive basis) and drop it into the directory to activate it (or move it out of the directory to deactivate it).



    Could you post your script here? I'll try to carve out a little time to look at it. Make sure you remove or obscure any personal information (like your email and/or password).

    Could you also post the results of the following command? Type: "which mail" at the command prompt and then copy the results and include them in your post.

    Finally, could you also post the results of the following command? Type "dpkg --get-selections | grep msmtp" at the command prompt and then copy the results and include them in your post.

    Based on the error you are reporting, though, it sounds like you don't have msmtp set up properly (or installed at all). But you indicated that mdadm is properly sending emails so I am a little lost.



    I'll try to look at it as quickly as possible. I know how frustrating it can be to have the system not behave but not know where to turn to even get started debugging it.

  2. #42
    Join Date
    Sep 2007
    Beans
    75

    Re: Step by step guide to setting up Ubuntu 11.10 server for Newbies!

    Quote Originally Posted by Zikofski View Post
    i tell you, you are a legend i have been following this for weeks now and slowly building up my server day by day, i am using 12.04 and so far it all works perfect with a few little things that i am posting so far

    Code:
    sudo chmod u+x /usr/local/sbin/continuous.sh
    this code didnt work for me, it seemed to work on the test script, when running it mannualy but i got this email every 5 mins haha

    Code:
    /bin/sh: 1: /usr/local/sbin/continuous.sh: Permission denied
    busted my balls getting this ever 5 mins for 2 whole days haha,

    it was fixed by using a different type of chmod code that you used after that,

    instead of u+x i did ugo+rwx

    and now i dont get any emails, but i know it worked as i got a error email from hdd temp which was fixed hopefully fixed the other guy who posted about that error

    again many many thanks for this, its long but omg so good, all the info is in one place no sodding about in multiple threads and pages

    P.S congrats on getting married too dude
    glad that worked for you. I'll have to go back and check to see why the original version didn't work for you. I suspect that your scripts were owned by you, but on my rig I must have had the scripts owned by root (or vice versa). It should be fine the way you got it to work though.

  3. #43
    Join Date
    Jun 2009
    Location
    PA - 215
    Beans
    18
    Distro
    Ubuntu 9.10 Karmic Koala

    Re: Step by step guide to setting up Ubuntu 11.10 server for Newbies!

    Thank you for posting such a great guide!
    I am having a problem with hddtemp and shutting down at a certain temperature. When I try to run the script sudo ~/hddtemp_monitor.sh I get the following error
    Code:
    frank@Server:~$ sudo ~/hddtemp_monitor.sh
    /home/frank/hddtemp_monitor.sh: line 11: [: 32┬: integer expression expected
    /home/frank/hddtemp_monitor.sh: line 11: [: 27┬: integer expression expected
    /home/frank/hddtemp_monitor.sh: line 11: [: 29┬: integer expression expected
    /home/frank/hddtemp_monitor.sh: line 11: [: 28┬: integer expression expected
    Also when I tried to send a test email from mdadm, it didn't work and I got the following error
    Code:
    frank@Server:~$ sudo mdadm --monitor --scan --test
    mdadm: Only one autorebuild process allowed in scan mode, aborting
    I'm not to sure what to do from here, any help from anyone would be much appreciated.
    Last edited by Philliesfan251; December 16th, 2012 at 07:32 PM.

  4. #44
    Join Date
    Oct 2009
    Beans
    Hidden!
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: Step by step guide to setting up Ubuntu 11.10 server for Newbies!

    Quote Originally Posted by Philliesfan251 View Post
    Thank you for posting such a great guide!
    I am having a problem with hddtemp and shutting down at a certain temperature. When I try to run the script sudo ~/hddtemp_monitor.sh I get the following error
    Code:
    frank@Server:~$ sudo ~/hddtemp_monitor.sh
    /home/frank/hddtemp_monitor.sh: line 11: [: 32┬: integer expression expected
    /home/frank/hddtemp_monitor.sh: line 11: [: 27┬: integer expression expected
    /home/frank/hddtemp_monitor.sh: line 11: [: 29┬: integer expression expected
    /home/frank/hddtemp_monitor.sh: line 11: [: 28┬: integer expression expected
    Also when I tried to send a test email from mdadm, it didn't work and I got the following error
    Code:
    frank@Server:~$ sudo mdadm --monitor --scan --test
    mdadm: Only one autorebuild process allowed in scan mode, aborting
    I'm not to sure what to do from here, any help from anyone would be much appreciated.
    Use UTF-8 encoding.
    Come to #ubuntuforums! We have cookies! | Basic Ubuntu Security Guide

    Tomorrow's an illusion and yesterday's a dream, today is a solution...

  5. #45
    Join Date
    Jun 2009
    Location
    PA - 215
    Beans
    18
    Distro
    Ubuntu 9.10 Karmic Koala

    Re: Step by step guide to setting up Ubuntu 11.10 server for Newbies!

    How do I go about doing that?

  6. #46
    Join Date
    Sep 2007
    Beans
    75

    Re: Step by step guide to setting up Ubuntu 11.10 server for Newbies!

    Quote Originally Posted by Philliesfan251 View Post
    Thank you for posting such a great guide!
    I am having a problem with hddtemp and shutting down at a certain temperature. When I try to run the script sudo ~/hddtemp_monitor.sh I get the following error
    Code:
    frank@Server:~$ sudo ~/hddtemp_monitor.sh
    /home/frank/hddtemp_monitor.sh: line 11: [: 32┬: integer expression expected
    /home/frank/hddtemp_monitor.sh: line 11: [: 27┬: integer expression expected
    /home/frank/hddtemp_monitor.sh: line 11: [: 29┬: integer expression expected
    /home/frank/hddtemp_monitor.sh: line 11: [: 28┬: integer expression expected
    Also when I tried to send a test email from mdadm, it didn't work and I got the following error
    Code:
    frank@Server:~$ sudo mdadm --monitor --scan --test
    mdadm: Only one autorebuild process allowed in scan mode, aborting
    I'm not to sure what to do from here, any help from anyone would be much appreciated.
    CharlesA might have the answer there, though I don't know how that would happen.

    Could you post your script here?

    How are you creating it (for example, are you using a gui text editing app to create it)?

    With regard to your second issue, it sounds to me like mdadm is already running and doing something (obviously I am no expert). Type the following and paste the results back here:

    Code:
    ps -ax | grep -i mdadm

  7. #47
    Join Date
    Sep 2007
    Beans
    75

    Re: Step by step guide to setting up Ubuntu 11.10 server for Newbies!

    Quote Originally Posted by Philliesfan251 View Post
    Thank you for posting such a great guide!
    I am having a problem with hddtemp and shutting down at a certain temperature. When I try to run the script sudo ~/hddtemp_monitor.sh I get the following error
    Code:
    frank@Server:~$ sudo ~/hddtemp_monitor.sh
    /home/frank/hddtemp_monitor.sh: line 11: [: 32┬: integer expression expected
    /home/frank/hddtemp_monitor.sh: line 11: [: 27┬: integer expression expected
    /home/frank/hddtemp_monitor.sh: line 11: [: 29┬: integer expression expected
    /home/frank/hddtemp_monitor.sh: line 11: [: 28┬: integer expression expected
    Also when I tried to send a test email from mdadm, it didn't work and I got the following error
    Code:
    frank@Server:~$ sudo mdadm --monitor --scan --test
    mdadm: Only one autorebuild process allowed in scan mode, aborting
    I'm not to sure what to do from here, any help from anyone would be much appreciated.

    One other question, how many disks do you have in your array? What are they named? For example, in my case I have 4 (actually, five if you include the one that holds the OS). The four that are being monitored are named:

    /dev/sdb
    /dev/sdc
    /dev/sdd
    /dev/sde

    The script assumes that you have these drives named as such (line 2).

  8. #48
    Join Date
    Sep 2007
    Beans
    75

    Re: Step by step guide to setting up Ubuntu 11.10 server for Newbies!

    Quote Originally Posted by Philliesfan251 View Post
    Also when I tried to send a test email from mdadm, it didn't work and I got the following error
    Code:
    frank@Server:~$ sudo mdadm --monitor --scan --test
    mdadm: Only one autorebuild process allowed in scan mode, aborting
    I'm not to sure what to do from here, any help from anyone would be much appreciated.
    Try modifying your command to add the following flag:

    --no-sharing


    So the command becomes:
    sudo mdadm --monitor --scan --no-sharing

  9. #49
    Join Date
    Jun 2009
    Location
    PA - 215
    Beans
    18
    Distro
    Ubuntu 9.10 Karmic Koala

    Re: Step by step guide to setting up Ubuntu 11.10 server for Newbies!

    Code:
    frank@Server:~$ ps -ax | grep -i mdadm
    Warning: bad ps syntax, perhaps a bogus '-'? See http://procps.sf.net/faq.html
     1079 ?        Ss     0:00 /sbin/mdadm --monitor --pid-file /var/run/mdadm/monitor.pid --daemonise --scan --syslog
    10749 pts/2    R+     0:00 grep --color=auto -i mdadm
    Code:
    #!/bin/bash
    HDDS="/dev/sd[a-d]"
    HDT=/usr/sbin/hddtemp
    LOG=/usr/bin/logger
    DOWN=/sbin/shutdown
    ALERT_LEVEL=1
    for disk in $HDDS
    do
      if [ -b $disk ]; then
            HDTEMP=$($HDT $disk | sed 's/\(.*\)://g' | awk -F '´┐Ż' '{ print $1}')
            if [ $HDTEMP -ge $ALERT_LEVEL ]; then
               echo "Your server is shutting down due to excessive hard drive temp. Drive: $d$
               $LOG "System going down as hard disk : $disk temperature $HDTEMP´┐Żcrossed its$
               sync;sync
               $DOWN -h 0
            fi
      fi
    done
    I have 4 and I edited the script so it would be correct.
    I'm editing it all from putty command line.
    Not to sure how to copy all from putty.
    Last edited by Philliesfan251; December 16th, 2012 at 08:35 PM.

  10. #50
    Join Date
    Sep 2007
    Beans
    75

    Re: Step by step guide to setting up Ubuntu 11.10 server for Newbies!

    Quote Originally Posted by Philliesfan251 View Post
    Code:
    frank@Server:~$ ps -ax | grep -i mdadm
    Warning: bad ps syntax, perhaps a bogus '-'? See http://procps.sf.net/faq.html
     1079 ?        Ss     0:00 /sbin/mdadm --monitor --pid-file /var/run/mdadm/monitor.pid --daemonise --scan --syslog
    10749 pts/2    R+     0:00 grep --color=auto -i mdadm
    Code:
    #!/bin/bash
    HDDS="/dev/sd[a-d]"
    HDT=/usr/sbin/hddtemp
    LOG=/usr/bin/logger
    DOWN=/sbin/shutdown
    ALERT_LEVEL=1
    for disk in $HDDS
    do
      if [ -b $disk ]; then
            HDTEMP=$($HDT $disk | sed 's/\(.*\)://g' | awk -F '´┐Ż' '{ print $1}')
            if [ $HDTEMP -ge $ALERT_LEVEL ]; then
               echo "Your server is shutting down due to excessive hard drive temp. Drive: $d$
               $LOG "System going down as hard disk : $disk temperature $HDTEMP´┐Żcrossed its$
               sync;sync
               $DOWN -h 0
            fi
      fi
    done
    I have 4 and I edited the script so it would be correct.
    I'm editing it all from putty command line.
    Not to sure how to copy all from putty.

    Ok, well at least line 11 is short enough that we can see it all.

    Do you see where your script differs from mine in the line above? Line 10? The awk statement has a different mix of characters than the degree symbol.

    Try running the following on the command line directly:

    Code:
    /usr/sbin/hddtemp /dev/sda | sed 's/\(.*\)://g' | awk -F '´┐Ż' '{ print $1}')
    This is just line 10 set up to run directly from the command line for disk sda. Other than substituting in the actual hddtemp command for the variable, and substituting in the sda drive for the variable, it is identical to what you posted. I suspect that the results of this command will not come back with an integer number. I suspect that that is because the original script was supposed to split the returned text on the degree symbol and throw away anything other than the first part (the part before the degree symbol). That is what awk does. If your script is looking for something other than the degree symbol, it won't split the line properly and you will get some extra cruft in there that should have been cut away.

    A second question I have is about your line 2

    You concatenate all your drives by saying /dev/sd[a-d]

    That's pretty fancy. I've never done that before. Does that actually give you the correct array? Just wondering.

Page 5 of 10 FirstFirst ... 34567 ... LastLast

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •