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

"monit" package for pfSense part 2

pfSense Packages
3
21
7.7k
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 May 10, 2013, 10:35 PM

    A gui would be much better as the configs could be added from there and the server config also as email server and email from and to.

    I am trying to see if anyone is willing to make that happen for £100.00 as i do not have much money. I do understand that its not very much but that all what I can afford.  Maybe others will want to contribute and we could have this as a package for everyone to use.

    Also the config link for openvpn that you pointed me to is for debian and its not the same for freebsd.  Still struggling :-(

    Cheers,

    Raj

    1 Reply Last reply Reply Quote 0
    • L
      Legion
      last edited by May 11, 2013, 1:43 AM

      Well, you have to extrapolate for your installation. On my machine:

      So, from that link I gave you I'd have something like:

      
      check process openvpn with pidfile /var/run/openvpn_server1.pid 
              start program = "/usr/local/sbin/openvpn --config /var/etc/openvpn/server1.conf start" 
              stop  program = "/usr/local/sbin/openvpn --config /var/etc/openvpn/server1.conf stop" 
              if failed host x.x.x.x port xxxx type udp then restart 
      
      

      And I'd probably have to find where openvpn is started by pfsense and disable it there and let monit take over starting/stopping instead.

      I still can't see how a package would be useful since each entry in the config file is unique and a package gui interface can't handle all the unique cases.

      1 Reply Last reply Reply Quote 0
      • R
        rajbps
        last edited by May 27, 2013, 9:04 AM

        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 May 27, 2013, 10:16 AM

          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 May 27, 2013, 10:18 AM

            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 May 27, 2013, 11:04 AM

              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 May 27, 2013, 11:13 AM

                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 May 27, 2013, 11:17 AM

                  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 Jul 28, 2013, 12:20 AM

                    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 Jul 28, 2013, 12:23 AM

                      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 Jul 28, 2013, 5:59 AM

                        @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 Jul 28, 2013, 8:00 AM

                          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 Jul 28, 2013, 10:24 AM

                            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 Jul 28, 2013, 9:43 PM

                              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 Jul 28, 2013, 11:00 PM

                                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.