Netgate Discussion Forum
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Search
    • Register
    • Login

    Solution: Groups in Lightsquid with USERNAMES :)

    Scheduled Pinned Locked Moved pfSense Packages
    2 Posts 1 Posters 5.0k Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • cyber7C Offline
      cyber7
      last edited by

      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

      When you pause to think, do you start again?

      2.2.4-RELEASE (amd64)
      built on Sat Jul 25 19:57:37 CDT 2015
      FreeBSD 10.1-RELEASE-p15
      and
      pfSense 2.3.2-RELEASE-p1 (amd64 full-install) on pfSense

      1 Reply Last reply Reply Quote 0
      • cyber7C Offline
        cyber7
        last edited by

        Example files:
        1. /scripts/hosts/internal_hosts
        129.1.1.200  my.fqdn.com  my
        129.1.1.201  manager.fqdn.com manager
        129.1.1.10  server.fqdn.com  server

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

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

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

        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

        When you pause to think, do you start again?

        2.2.4-RELEASE (amd64)
        built on Sat Jul 25 19:57:37 CDT 2015
        FreeBSD 10.1-RELEASE-p15
        and
        pfSense 2.3.2-RELEASE-p1 (amd64 full-install) on pfSense

        1 Reply Last reply Reply Quote 0
        • First post
          Last post
        Copyright 2025 Rubicon Communications LLC (Netgate). All rights reserved.