Solution: Groups in Lightsquid with USERNAMES :)

  • Hi Guys
    LightSquid reports is of no use to management in my business, as they do not have a clue what the IP addresses means.

    NOTE: /etc/hosts can be edited, but it is not permanently.  Is there a place to add ip/name info into to make these available all the time?

    Here is what I did:

    • I created a "/scripts/hosts" directory.

    • I created all my ip/names in a file called "internal_hosts" in this directory.

    • In the "/scripts" directory I created a script that looks for a specific host in the "/etc/hosts" file, if not found, add the content of "/scripts/hosts/internal_hosts" to the "/etc/hosts" file.

    • I then edited "/usr/local/etc/lightsquid/groups.cfg" and added my names/groups.

    • I then added a crontab entry that checks every minute for the host mentioned in the script

    Now, when I display my LightSquid reports (or my management does), every department is listed as a group and every user added into the "/etc/hosts" files is displayed within the department.

    In my next post I will post the script I use, an example of my hosts file and an example of my groups file.

    Kind regards
    Aubrey Kloppers
    ps - If this is not correct (the above mentioned steps), please could yo give me a better way to resolve the issue?
    ps2- All my hosts resolve within my network properly

  • Example files:
    1. /scripts/hosts/internal_hosts  my manager  server

    2. /usr/local/etc/lightsquid/groups.cfg
    my         01     itgroup
    manager 02    managergroup
    server    03     servergroup

    3. crontab
    */1 * * * * sh /scripts/ > /dev/null 2>&1

    4. /scripts/
    HOSTS=grep my /etc/hosts | wc | awk '{print $1}'
    if [ "$HOSTS" != 0 ]; then
    cat /scripts/hosts/internal_hosts >> /etc/hosts

    That is it, guys.  Nothing to it :)

    Kind regards
    Aubrey Kloppers
    South Africa

    ps - When I look at my LightSquid reports, the groups and users have been defined.  Makes for much easer reading

Log in to reply