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

Remote monitoring using iOS?

Scheduled Pinned Locked Moved General pfSense Questions
25 Posts 3 Posters 8.4k 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.
  • M Offline
    Mellowlynx
    last edited by Nov 18, 2012, 12:54 PM

    @stephenw10:

    And is 10.56 a relevant time? Nothing at 11.52 as you mentioned earlier.

    Not that I know of…

    @stephenw10:

    Two ways to kill istatd.
    1. From the CLI, menu option 8, run 'top'. Press 'q' to quit.
    From there you will see the process number for istatd and you can stop it with 'kill 24675' or whatever the number is.
    2. Since there is only one process called istatd (unless something is wrong) you can kill it directly with 'killall istatd'.

    Steve

    If I kill it, webgui will work and first time it showed.

    
    $ istatd [-c] [-a 172.16.32.1] [-p] [-d]
    Could not get disk data for '/home'. Device not found.
    
    

    If I command out that line, webgui is still not working after start istat

    Here is the full istat config

    
    #
    # /etc/istat.conf: Configuration for iStat server
    #
    
    #network_addr           127.16.32.1
    network_port           5109
    server_code              12345
    server_user              nobody
    server_group             nobody
    # server_socket          /tmp/istatd.sock
    server_pid               /var/run/istatd.pid
    cache_dir                /var/db/istatd
    
    # Note: Only support for one network interface, limited by client.
    monitor_net            ( re0 )
    
    # Array of disks to monitor. Specify mount path or device name.
    #monitor_disk             ( / /home )
    
    # Set to 1 if you want to use mount path as label instead of the device name.
    disk_mount_path_label    1
    
    # Try to probe the filesystem for disk label, will override the mount path label.
    disk_filesystem_label    1
    
    # Set custom disk label. Will override all other labels.
    # disk_rename_label        /dev/sda1  "root"
    # disk_rename_label        /home      "home"
    
    # End of file
    
    
    1 Reply Last reply Reply Quote 0
    • P Offline
      phil.davis
      last edited by Nov 18, 2012, 1:15 PM

      @rcktboy:

      Here is all whats in PHP_errors.log

      [18-Nov-2012 10:56:38 UTC] PHP Warning:  Cannot modify header information - headers already sent by (output started at /etc/inc/authgui.inc:212) in /usr/local/www/guiconfig.inc on line 49
      [18-Nov-2012 10:56:38 UTC] PHP Warning:  Cannot modify header information - headers already sent by (output started at /etc/inc/authgui.inc:212) in /usr/local/www/guiconfig.inc on line 50
      [18-Nov-2012 10:56:38 UTC] PHP Warning:  Cannot modify header information - headers already sent by (output started at /etc/inc/authgui.inc:212) in /usr/local/www/guiconfig.inc on line 51
      [18-Nov-2012 10:56:38 UTC] PHP Warning:  Cannot modify header information - headers already sent by (output started at /etc/inc/authgui.inc:212) in /usr/local/www/guiconfig.inc on line 52
      [18-Nov-2012 10:56:38 UTC] PHP Warning:  Cannot modify header information - headers already sent by (output started at /etc/inc/authgui.inc:212) in /usr/local/www/guiconfig.inc on line 53
      
      

      Those are "normal" messages that are spat out when the WebConfigurator is started at boot time.
      Coincidentally, these warnings have been fixed/removed by a recent commit a couple of days ago: https://github.com/bsdperimeter/pfsense/commit/73ebd062315c78bc64adff529ce3862d91ce2e4b
      If you are on a very recent 2.1 snapshot then you should find that /tmp/PHP_errors.txt does not even exist when bootup is finished - there are no warnings any more. The file is only created when the first PHP warning or error happens.

      As the Greek philosopher Isosceles used to say, "There are 3 sides to every triangle."
      If I helped you, then help someone else - buy someone a gift from the INF catalog http://secure.inf.org/gifts/usd/

      1 Reply Last reply Reply Quote 0
      • S Online
        stephenw10 Netgate Administrator
        last edited by Nov 18, 2012, 1:18 PM

        @rcktboy:

        #network_addr           127.16.32.1

        I assume this is a typo and you mean 172.16.32.1?

        If not that is conflicting with the address you are sending via the start command.
        Since the only thing you are specifying via the command line switches is the address, and that's in the config file anyway, you should be able to start it with simply 'istatd'.

        I don't think /home is a mount point, though I only have a Nano install of 2.0.1 to check against.

        Also your monitoring of / doesn't agree with your labeling of /dev/sda1 but since all the precedding options seem to overide each other it's hard to say what should happen there.

        Steve

        1 Reply Last reply Reply Quote 0
        • M Offline
          Mellowlynx
          last edited by Nov 18, 2012, 1:30 PM

          Yes, thats a typo.

          But I tried something else…
          I did not execute the istat [-d] in the webgui
          but in the ssh console and istat runs AND the webgui is still working!

          Can I add the istat rule so it starts as startup somewhere?
          Or do I have to modify the rc file?

          1 Reply Last reply Reply Quote 0
          • S Online
            stephenw10 Netgate Administrator
            last edited by Nov 18, 2012, 1:52 PM Nov 18, 2012, 1:48 PM

            Ah that explains it! I didn't realise you were using the gui command tool.
            Yes you can't run a function there that does not finish. It will just cause a php process to wait endlessly and, as you found, kills the webgui. You can breakout of that by killing all the php processes, 'killall php'.

            Here is the file as put in place by the package:

            
            #!/bin/sh
            
            # PROVIDE: istatd
            # REQUIRE: LOGIN
            #
            # Add the following lines to /etc/rc.conf.local or /etc/rc.conf
            # to enable this service:
            #
            # istatd_enable (bool):   Set to NO by default.
            #               Set it to YES to enable istatd.
            #
            
            . /etc/rc.subr
            
            name="istatd"
            rcvar=istatd_enable
            
            command=/usr/local/bin/${name}
            
            load_rc_config $name
            
            : ${istatd_enable="NO"}
            : ${istatd_config="/usr/local/etc/istat.conf"}
            
            command_args="-d -c $istatd_config"
            
            run_rc_command "$1"
            

            It expects you to add 'istatd_enable="YES"' to /etc/rc.conf. However in pfSense all the conf files in /etc are generated at boot by a series of scripts from settings in the pfSense config.xml file. Hence if you add that line it will be overwritten at boot. I'm unsure of the correct way to do this.  :-\

            Steve

            1 Reply Last reply Reply Quote 0
            • S Online
              stephenw10 Netgate Administrator
              last edited by Nov 18, 2012, 2:00 PM

              You could do something crude, as I have in the past.
              Create a file called, say. istatd.sh in /usr/local/etc/rc.d and put in it:

              
              #!/bin/sh
              #
              #File to start istatd until a proper package is created.
              
              /usr/local/bin/istatd -c /usr/local/etc/istat.conf -d
              
              

              Set the file permissions so it can be executed. Cross your fingers and reboot.  ;)

              Steve

              1 Reply Last reply Reply Quote 0
              • M Offline
                Mellowlynx
                last edited by Nov 18, 2012, 2:19 PM

                I googled and found this :)

                "Executing commands at boot time"

                The hidden config.xml option <shellcmd>will run the command specified towards the end of the boot process.
                Above the line, add a line such as the following:

                <shellcmd>mycommand -a -b -c 123</shellcmd>
                

                Where "mycommand -a -b -c 123" is the command to run. You can add multiple <shellcmd>lines to execute multiple commands. Save your changes and restore the modified configuration.</shellcmd></shellcmd>

                (source: http://doc.pfsense.org/index.php/Executing_commands_at_boot_time)

                Did that, rebooted and YAY, it works :)

                BIG thanks for your help! :)

                1 Reply Last reply Reply Quote 0
                • S Online
                  stephenw10 Netgate Administrator
                  last edited by Nov 18, 2012, 2:25 PM

                  Good call that's a better way to do it. Don't know why I didn't suggest that.  ::)

                  Screenshots (from your phone) to encourage others to try it?

                  Steve

                  1 Reply Last reply Reply Quote 0
                  • M Offline
                    Mellowlynx
                    last edited by Nov 18, 2012, 5:31 PM

                    Working on that :)

                    Here is a iPhone 5 screenshot

                    And here a iPad one

                    1 Reply Last reply Reply Quote 0
                    • S Online
                      stephenw10 Netgate Administrator
                      last edited by Nov 18, 2012, 6:02 PM

                      Nice.  :)

                      Steve

                      1 Reply Last reply Reply Quote 0
                      25 out of 25
                      • First post
                        25/25
                        Last post
                      Copyright 2025 Rubicon Communications LLC (Netgate). All rights reserved.
                        This community forum collects and processes your personal information.
                        consent.not_received