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

    "monit" package for pfSense part 2

    Scheduled Pinned Locked Moved pfSense Packages
    21 Posts 3 Posters 7.9k 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.
    • R
      rajbps
      last edited by

      Hiya,

      Sorry for the very late reply.

      A gui that could simplify the config would be a good thing and an email notification to let the administrator know that a service was restarted.

      I do understand that its not the same for everyone as it depends on what you have on your box but maybe allowing to add config from the gui itself might resolve that.

      On another note could you advise how you been able to sort this bit out pls?

      "- I use the Filer package, suggested in another thread by marcelloc, to modify an /etc/rc.conf.local to include the line monit_enable="YES". This is an environment variable that monit requires to fire up. /usr/local/etc/rc.d/monit has a few details about that."

      Again thanks for all the help.

      Cheers,

      Raj

      1 Reply Last reply Reply Quote 0
      • L
        Legion
        last edited by

        Like this:

        Or you could probably edit /usr/local/etc/rc.d/monit directly to set monit_enable="YES", but I'm not very good at shell scripting, never was, so I can only read enough to get the gist of what a script does, not write my own.

        1 Reply Last reply Reply Quote 0
        • L
          Legion
          last edited by

          Filer is one of the standard pfSense packages and once you install it it lives under the Diagnostics -> Filer menu.

          1 Reply Last reply Reply Quote 0
          • R
            rajbps
            last edited by

            Thanks again for the reply :-)

            Now in the config, you just modify the line:

            Monit has an embedded web server which can be used to view status of

            services monitored and manage services from a web interface. See the

            Monit Wiki if you want to enable SSL for the web server.

            set httpd port 2812 and
                use address localhost  # only accept connection from localhost
                allow X.X.X.X        # allow localhost to connect to the server and
                allow admin:monit      # require user 'admin' with password 'monit'
                allow @monit          # allow users of group 'monit' to connect (rw)
                allow @users readonly  # allow users of group 'users' to connect readonly

            Where the X.X.X.X would be the ip of the pfsense box is that correct?

            Cheers,

            Raj

            1 Reply Last reply Reply Quote 0
            • R
              rajbps
              last edited by

              Sorry sorted it out you just modify one line:

              set httpd port 2812 and
                  use address localhost  # only accept connection from localhost
                  allow X.X.X.X      # allow localhost to connect to the server and
                  allow admin:monit      # require user 'admin' with password 'monit'
                  allow @monit          # allow users of group 'monit' to connect (rw)
                  allow @users readonly  # allow users of group 'users' to connect readonly

              where X.X.X.X is the machine from which you are trying to connect.

              Do you have a 32 bit or 64 bit pfsense as the package is in both flavours and I am running 64 bit pfsense.

              Cheers,

              Raj

              1 Reply Last reply Reply Quote 0
              • L
                Legion
                last edited by

                Mine is slightly different. I allow localhost and some of my private subnets. No users, no passwords. There is plenty of information if you search the internet of different configurations.

                I am running 32-bit

                1 Reply Last reply Reply Quote 0
                • R
                  rajbps
                  last edited by

                  Ok,

                  I manage to get monit working well on pfsense fingers cross.

                  Now if I reboot pfsense, I need to start monit via shell to be able to access the gui.

                  Is there a way to get monit started without any input from me pls.

                  I made a wee install doc with a lot of help from this forum and google that I am posting here.

                  The work in there is not mine, I just gathered it in that doc

                  Hope it can help someone also and thanks to everyone for the help.

                  Cheers,

                  raj

                  [monit pfsense install for forum.txt](/public/imported_attachments/1/monit pfsense install for forum.txt)

                  1 Reply Last reply Reply Quote 0
                  • R
                    rajbps
                    last edited by

                    Sorry forgot to ask another question,

                    When I do a backup of the firewall via the diag => Backup and restore will it also backup this custom install of monit and the config of it.

                    Cheers,

                    Raj

                    1 Reply Last reply Reply Quote 0
                    • L
                      Legion
                      last edited by

                      @rajbps:

                      Is there a way to get monit started without any input from me pls.

                      Read my first post again. I use etc/rc.d, but there are other methods.

                      1 Reply Last reply Reply Quote 0
                      • R
                        rajbps
                        last edited by

                        Hi Legion,

                        I did that as per your post
                        "/usr/local/etc/rc.d/monit
                        There duplicate the monit and rename it to monit.sh
                        So you will have the following in that directory:
                        /usr/local/etc/rc.d/monit
                        /usr/local/etc/rc.d/monit.sh

                        Now we need to modify /etc/rc.conf.local to include the line monit_enable="YES"
                        So install the filer package from the normal package manager.

                        Then go to Diagnostics -> Filer menu
                        There you can modify /etc/rc.conf.local

                        Now we need to modify :
                        /usr/local/etc/monitrc.sample
                        So that we have :
                        /usr/local/etc/monitrc

                        So just duplicate it so that folder will have both
                        /usr/local/etc/monitrc.sample
                        /usr/local/etc/monitrc"

                        Now when i reboot pfsense, monit does not start by itself.

                        :-(

                        1 Reply Last reply Reply Quote 0
                        • R
                          rajbps
                          last edited by

                          Ok rebooted pfsense and on the bootup console, i can see :
                          Starting /usr/local/etc/rc.d/monit.sh…done

                          But when I try to connect nothing.

                          If i log on the console and run the following command :

                          monit

                          This returns the following :

                          Starting monit daemon with http interface at [x.x.x.x:yyyy]

                          x is the ip
                          y is the port

                          So the startup script runs but without typing "monit" on the pfsense shell, it does not start the server.

                          Any ideas why.

                          My config file is attached here.

                          Cheers for any ideas/help.

                          Raj

                          [monit pfsense install for forum.txt](/public/imported_attachments/1/monit pfsense install for forum.txt)

                          1 Reply Last reply Reply Quote 0
                          • R
                            rajbps
                            last edited by

                            Hi Legion,

                            Can you show me a copy of you monit.sh file pls.

                            I am thinking that the issue might be in there.

                            Or do you have any other ideas.

                            Cheers,

                            Raj

                            1 Reply Last reply Reply Quote 0
                            • R
                              rajbps
                              last edited by

                              OK found my problem, permission.

                              The permission of  /usr/local/etc/rc.d/monit.sh should be 0755

                              All starting fine now :-)

                              Cheers

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