• 1746.vf1673cfe690a

      This configuration is available from UI at <base url>/computer/configure

      It would be nice to have that configuration supported by JCasC.

      Not sure if that's some particular plugin, so binding the ticket to the "core" component.

      Currently, it's necessary to use the groovy scripting to achieve that:

      import hudson.node_monitors.DiskSpaceMonitor
      ComputerSet.getMonitors().replace(new DiskSpaceMonitor("10GB"))
      

       

          [JENKINS-64816] Support "Preventive Node Monitoring" for JCasC

          Seen also here related to plugin versioncolumn : https://issues.jenkins.io/browse/JENKINS-63971

          Valentin Delaye added a comment - Seen also here related to plugin versioncolumn : https://issues.jenkins.io/browse/JENKINS-63971

          I'm curious about the effort here. I would like to see if I can submit a PR but probably miss some core experience

          Valentin Delaye added a comment - I'm curious about the effort here. I would like to see if I can submit a PR but probably miss some core experience

          Markus Winter added a comment -

          Requires CasC plugin 1746.vf1673cfe690a 

          and Jenkins 2.433 for proper functionality of the node monitors included in core.

          Following plugins support to be configured via CasC:

          Versions Monitor (https://github.com/jenkinsci/versioncolumn-plugin/pull/189)

          Inodes Monitor

          Other plugins can't be configured, they will be set to ignored. which is no problem. Except writeable file system (only 14 installs) all have no configuration anyway and don't take agents offline.

           

          Markus Winter added a comment - Requires CasC plugin 1746.vf1673cfe690a  and Jenkins 2.433 for proper functionality of the node monitors included in core. Following plugins support to be configured via CasC: Versions Monitor ( https://github.com/jenkinsci/versioncolumn-plugin/pull/189 ) Inodes Monitor Other plugins can't be configured, they will be set to ignored. which is no problem. Except writeable file system (only 14 installs) all have no configuration anyway and don't take agents offline.  

          Vittorio added a comment -

          I have added the following block to my JCasC in order to achieve what was originally requested by the reporter:

          jenkins:
            nodeMonitors:
            - diskSpaceMonitor:
                freeSpaceThreshold: "10GB"
            - tmpSpace:
                freeSpaceThreshold: "10GB" 

          While the thresholds of both "Free disk space" and "Free temp space" are adjusted to 10GB, I see that the other 4 monitors "Architecture", "Clock Difference", "Free Swap Space" and "Response Time" get disabled. I could not find a way to set them, when I was checking my JCasC configuration under <base url>/manage/configuration-as-code/viewExport.

          How can I set them? Should I create a new issue for this matter? Thanks in advance.

          Vittorio added a comment - I have added the following block to my JCasC in order to achieve what was originally requested by the reporter: jenkins:   nodeMonitors:   - diskSpaceMonitor:       freeSpaceThreshold: "10GB"   - tmpSpace:       freeSpaceThreshold: "10GB" While the thresholds of both "Free disk space" and "Free temp space" are adjusted to 10GB, I see that the other 4 monitors "Architecture", "Clock Difference", "Free Swap Space" and "Response Time" get disabled. I could not find a way to set them, when I was checking my JCasC configuration under <base url>/manage/configuration-as-code/viewExport . How can I set them? Should I create a new issue for this matter? Thanks in advance.

          Markus Winter added a comment - - edited

          Are you using already Jenkins version 2.433 or higher? Only then you can configure them.

          The monitors "Architecture", "Clock Difference" and "Free Swap Space", have no further configuration and also will never take an agent offline. So it makes no difference if you include them or not. JCasC will still ensure that they are created with "ignored".

          "Response Time" has also no configuration but it can take agents offline (or to be more precise it will disconnect agents), but only when you have Jenkins 2.433 you can configure that with JCasC.  You would configure it with

          nodeMonitors:
            - "architecture"
            - "clock"
            - diskSpace:
                freeSpaceThreshold: "10GB"
                freeSpaceWarningThreshold: "20GB"
            - "responseTime"
            - swapSpace:
                ignored: true
            - tmpSpace:
                freeSpaceThreshold: "1GiB"
                freeSpaceWarningThreshold: "2GiB"

          Markus Winter added a comment - - edited Are you using already Jenkins version 2.433 or higher? Only then you can configure them. The monitors "Architecture", "Clock Difference" and "Free Swap Space", have no further configuration and also will never take an agent offline. So it makes no difference if you include them or not. JCasC will still ensure that they are created with "ignored". "Response Time" has also no configuration but it can take agents offline (or to be more precise it will disconnect agents), but only when you have Jenkins 2.433 you can configure that with JCasC.  You would configure it with nodeMonitors:   - "architecture"   - "clock"   - diskSpace:       freeSpaceThreshold: "10GB"       freeSpaceWarningThreshold: "20GB" - "responseTime"   - swapSpace:       ignored: true   - tmpSpace:       freeSpaceThreshold: "1GiB"     freeSpaceWarningThreshold: "2GiB"

          Vittorio added a comment -

          Thanks for your reply. I am sorry but I have misread the Jenkins version requirement in your message of the 26th November and I have erroneously though that my Jenkins instance was new enough: I have actually Jenkins 2.426.1 now, so I will have to wait.

          Vittorio added a comment - Thanks for your reply. I am sorry but I have misread the Jenkins version requirement in your message of the 26th November and I have erroneously though that my Jenkins instance was new enough: I have actually Jenkins 2.426.1 now, so I will have to wait.

          Vittorio added a comment -

          I could finally update Jenkins to 2.440.1 and I confirm that I can successfully configure the node monitors now

          Vittorio added a comment - I could finally update Jenkins to 2.440.1 and I confirm that I can successfully configure the node monitors now

            mawinter69 Markus Winter
            bahdaden Sasha
            Votes:
            5 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated:
              Resolved: