FireMotD – Dynamic MotD Generator

10 Comments

  1. Running bash from mintty in ConEmu looks like running bash inside Ubuntu inside VirtualBox in Windows.
    Check cygwin/msys connector developed specially for ConEmu.

    1. Hey Maximus, thanks for your suggestion. I’m rather busy atm, but I will definitely give your cygwin msys connector a try once I find some time! Happy New Year!! 😉

  2. an improvement of your uptime awk code:

    1. Adam, in the later releases I’m getting the date and time separately, so that I can give them different colors.
      UptimeDays=$(awk ‘{print int($1/86400)}’ /proc/uptime)
      UptimeHours=$(awk ‘{print int($1%86400/3600)}’ /proc/uptime)
      UptimeMinutes=$(awk ‘{print int(($1%3600)/60)}’ /proc/uptime)
      UptimeSeconds=$(awk ‘{print int($1%60)}’ /proc/uptime)

  3. For modern RedHat systems (tested on EL6+), I would personally recommend changing the calculations on either ProcessCount or ProcessMax. Running this as unprivileged users (as part of my profile), I was seeing results like this:

    “Processes = 1460 running processes of 1024 maximum processes”.

    This is because the ulimit command used here is the per-user limit, but the ps method used for ProcessCount will get you the *system* max.

    Personally I don’t care about the per-user limits, I use FireMOTD for system-level data (a user-specific line could always be added). So I changed the commands to the following:

    ProcessCount=”$(ps -Afl –no-headers | wc -l)”
    ProcessMax=”$(sysctl -n kernel.pid_max)”

    Note I also added a –no-headers here to correct an (admittedly minor) off-by-one error to the process count. =)

    Something that we also find specifically useful at my company (so I’ll share here in case other readers are interested) is the hardware CPU layout:

    ## CPU Layout = 16 core(s) distributed across 2 socket(s)

    You already had the CpuProc calculation, I just added a CpuSock:

    CpuSock=”$(cat /proc/cpuinfo | grep -i ‘physical id’ | sort -u | wc -l)”

    Then edited the template (unfortunately I only have done the one that we use, so at this time I don’t have a full patch to submit to you). If the system has been detected as virtual, I do an extra calculation and change the display slightly:

    ## CPU Layout = 8 virtual core(s) assigned

    Just to keep from being confusing.

  4. Unable to download from github, not sure if a github issue or something else.

    # wget https://github.com/willemdh/FireMotD/archive/v5.14.160701.tar.gz
    –2016-10-21 11:39:48– https://github.com/willemdh/FireMotD/archive/v5.14.160701.tar.gz
    Resolving github.com (github.com)… 192.30.253.112
    Connecting to github.com (github.com)|192.30.253.112|:443… connected.
    HTTP request sent, awaiting response… 302 Found
    Location: https://codeload.github.com/willemdh/FireMotD/tar.gz/v5.14.160701 [following]
    –2016-10-21 11:39:48– https://codeload.github.com/willemdh/FireMotD/tar.gz/v5.14.160701
    Resolving codeload.github.com (codeload.github.com)… failed: Name or service not known.
    wget: unable to resolve host address ‘codeload.github.com’

  5. How to add some customized information?
    for example:
    ###############################################################################
    ########################## XXX-XXX-DB-01 #################### 5.14.160701 ####
    ###############################################################################
    ## XXXXX Database
    ## System Administrator = Roger
    ## Ip = 10.99.1.94
    ## Release = Enterprise Linux Enterprise Linux Server release 5.11 (Carthage)
    ## ……
    ## ……
    ###############################################################################

    1. You’ll have to script custom info yourself for now. But something like adding a system administrator is not a bad idea. Please make a feature request for that on GitHub if you ever want this to be implemented.

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code class="" title="" data-url=""> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong> <pre class="" title="" data-url=""> <span class="" title="" data-url="">

4 × three =