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

    Monitor and restart custom tasks

    Scheduled Pinned Locked Moved General pfSense Questions
    4 Posts 3 Posters 2.2k 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.
    • P
      pcatiprodotnet
      last edited by

      I start two tasks (dnsmasq & olsr) with custom boot shell scripts and not the gui.
      How do I include my tasks with custom parameters into pfSense's normal mechanism that monitors stopped/crashed tasks and restarts them when needed or perhaps even reboots?  Though I've never had a problem with this yet on any of my pfSense routers after months of uptime, I just wanted to be prepared.
      Thank you,
      -pc

      1 Reply Last reply Reply Quote 0
      • H
        hoba
        last edited by

        Either use the hidden config.xml parameters ( http://faq.pfsense.com/index.php?action=artikel&cat=10&id=38&artlang=en&highlight=hidden ) to start them at boot or maybe add the scripts to your crontab.

        1 Reply Last reply Reply Quote 0
        • S
          sullrich
          last edited by

          pfSense does not include service supervision.  You will need to roll your own.

          1 Reply Last reply Reply Quote 0
          • P
            pcatiprodotnet
            last edited by

            Does anyone have a Script to share capable of monitoring task(s) something like this ? …

            1. Verify T.1 Task(s) are active process(es) in good condition as far as can reasonably be determined, if not take T.2 action.
            2. If any T.1 Task(s) are consuming over C% CPU, checked every I time interval, occuring R number of times in a row, then take T.2 action.
            3. Check the system.log every I time interval for occurance(s) of L.1 string list, if found take L.2 action.
            4. If ping times to P.1 host are above P.2 ms, checked every P.3 time interval, occuring P.4 number of times in a row, take P.5 action.

            Example Constants I define: T.1=('olsr','dnsmasq') : T.2=('reboot', 'restart'), C=30 %, I=30 sec, R=3, L.1=('hardware failure','halted') : L.2=('reboot','reboot'), P.1='192.168.1.1', P.2=500 ms, P.3=30 sec, P.4=5, P.5='reset ath0'),  -- actions: 'reboot'=reboot, 'reset ath0'=reset interface, 'restart'=run /usr/local/etc/rc.d/'T.1'.sh but if restart or reset fails or is triggered again within 12hrs then reboot.

            If not, I may post a small bounty.
            Thanks,

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