Status and checks...



  • In the pFsense web site on the home page, there are a pile of nice status and check information along the left side. Things like uptime, performance stats, service status, and load balancing status.

    I would like to create Nagios alerts based on this information. To do that, I need something scriptable that supplies that same information. I am hoping I don't have to try and reverse engineer the website.

    Can anyone point me in the right direction to figure out the OS-level commands that will supply this information? In particular the service status and load balancer status.

    Thanks!



  • That's not a website...that your GUI of your pfSense box. You should check packages available so you won't have to reinvent the wheel.



  • @turnbulld said in Status and checks...:

    I would like to create Nagios alerts based on this information. To do that, I need something scriptable that supplies that same information. I am hoping I don't have to try and reverse engineer the website.

    Solutions exist already.
    I installed 'a long time ago' a FreeBSD package called 'munin-node' which is comparable with nagios.
    This had to be done using the console or SSH access. The old fashioned way.
    Btw : I run the cliunt or node version, the server is running somewhere on the net.

    Installing non-pfSense packages is a "do it yourself" thing, you'll be on your own. Although ... check out this forum and see for yourself who installed nagios and how they did it.

    Btw : reverse engineer ? It all PHP 😀

    @turnbulld said in Status and checks...:

    Can anyone point me ....

    No problem, just point and click here.



  • Thanks but I did all the Google searches before posting the question. The "GUI" is absolutely a website served from the pfSense appliance through nginx it appears.

    However, it turns out the answer I needed was to use relayctl to see the status of current load balancers as well as other typical BSD commands (uptime, df, etc..). The "GUI" apparently uses these same tools as well to create the dashboard you see when it first logs in.

    So, now the task is to write the csh script (neither bash nor ksh is avaialble in the appliance's OS) that mines this info out in a way that Nagios can consume it.

    I might maybe have to look at the available SNMP options first though. Seems like this would be a natural thing to want to monitor.



  • Something like this ?



  • @Gertjan That's for sure the SNMP info. I went a little lower level and did an snmpwalk against the defined community. As with what you linked, there is nothing specific to the load balancer which I find a little odd. Yes, I get that one can wath the individual servers but I can conceive of a case where the firewall has a problem and that causes an issue with the load balancer config itself. I wanted a check on the state of each of my load balancers (I have one for an HTTP site and another for an HTTPS site both with three servers).

    I ended up writing a csh script that took the output from relayctl show summary, parsed out the relevant bits for a load balancing conjfig given at the command line, then examined those bits to determine how many hosts, what their backend IP's are, and whether the system sees them as up or not.

    This returns a single line of output listing the hosts found, their state, and any messages applicable to what I found during the script run. It gives a 0 result code for ok, 1 for warning and 2 for critical. I can run this in Nagios now using either nrpe or through passwordless ssh and get the monitor I want.

    So, my original issue is solved but it would be nice if there were a list of commands that are the source of the data on the dashboard. Yeah, I know they are regular BSD commands mostly (pfctl is at least one exception) but having the list would have saved me a lot of time rummaging around for commands with which I was unfamiliar.



  • @turnbulld said in Status and checks...:

    That's for sure the SNMP info.

    Noop.
    But the same source.
    It's Munin digging into the system using whatever is needed to present stats.
    The plugins are written in ... perl, C, bash, etc.

    @turnbulld said in Status and checks...:

    As with what you linked, there is nothing specific to the load balancer which I find a little odd.

    Probably because I do not have multiple WAN's, so I didn't activate 'load balance' related Munin plugins.

    @turnbulld said in Status and checks...:

    list of commands that are the source of the data on the dashboard.

    The code is the source - it reads like a manual.!!
    The widgets on the dashboard are just PHP files. Everything is in there - here /usr/local/www/widgets/widgets/....


Log in to reply