| 1 | #*doc-module: |
|---|
| 2 | crcnetd - CRCnet Configuration System Daemon Template |
|---|
| 3 | |
|---|
| 4 | This template creates the rrdbot-script configuration file |
|---|
| 5 | *# |
|---|
| 6 | #attr $author = "Chris Browning (ckb6@cs.waikato.ac.nz)" |
|---|
| 7 | #attr $version = "$Id: rrdbot_script_conf.tmpl 1163 2006-12-01 02:09:36Z ckb6 $" |
|---|
| 8 | #attr $copyright = "Copyright (C) 2006 The University of Waikato" |
|---|
| 9 | #attr $license = "No usage or redistribution rights are granted. See LICENSE for details." |
|---|
| 10 | #attr $eventList = [] |
|---|
| 11 | #attr $fileName = "rrdbot.conf" |
|---|
| 12 | #attr $serviceName = "rrdbot" |
|---|
| 13 | #from crcnetd._utils.ccsd_cfengine import ccs_template |
|---|
| 14 | #extends ccs_template |
|---|
| 15 | #compiler-settings |
|---|
| 16 | ## Change the Cheetah start tokens so that we don't conflict with DHCP syntax |
|---|
| 17 | cheetahVarStartToken = % |
|---|
| 18 | directiveStartToken = ! |
|---|
| 19 | commentStartToken = !! |
|---|
| 20 | #end compiler-settings |
|---|
| 21 | # |
|---|
| 22 | # CRCnet rrdbot-script.conf |
|---|
| 23 | # |
|---|
| 24 | # This file was automatically generated on the date below, DO NOT EDIT |
|---|
| 25 | # $Date$ |
|---|
| 26 | |
|---|
| 27 | |
|---|
| 28 | #This is where we setup the configuration |
|---|
| 29 | !set %rrd = %services["rrdbot"] |
|---|
| 30 | [config] |
|---|
| 31 | server = %server_name:%port |
|---|
| 32 | graphport = %rrd.graphport |
|---|
| 33 | !for %classname in %rrd.classes |
|---|
| 34 | !set %clas = %rrd.classes[%classname] |
|---|
| 35 | [%clas["class_name"] = %clas["poll"]] |
|---|
| 36 | !if %clas["ipfromoid"]: |
|---|
| 37 | ipfromoid = %clas["ipfromoid"] |
|---|
| 38 | !end if |
|---|
| 39 | !if %clas["skip_software_loop"]: |
|---|
| 40 | skip_software_loop = %clas["skip_software_loop"] |
|---|
| 41 | !end if |
|---|
| 42 | !if %clas["key"]: |
|---|
| 43 | key = %clas["key"] |
|---|
| 44 | !end if |
|---|
| 45 | !if %clas["interval"]: |
|---|
| 46 | interval = %clas["interval"] |
|---|
| 47 | !end if |
|---|
| 48 | !if %clas["cf"]: |
|---|
| 49 | cf = %clas["cf"] |
|---|
| 50 | !end if |
|---|
| 51 | !if %clas["archive"]: |
|---|
| 52 | archive = %clas["archive"] |
|---|
| 53 | !end if |
|---|
| 54 | |
|---|
| 55 | !for %var in %clas["variables"] |
|---|
| 56 | %var["name"]:poll = %var["poll"] |
|---|
| 57 | %var["name"]:type = %var["type"] |
|---|
| 58 | !if %var["type"] == "GAUGE" and %var["min"] != '': |
|---|
| 59 | %var["name"]:min = %var["min"] |
|---|
| 60 | !end if |
|---|
| 61 | !if %var["type"] == "GAUGE" and %var["max"] != '': |
|---|
| 62 | %var["name"]:max = %var["max"] |
|---|
| 63 | !end if |
|---|
| 64 | |
|---|
| 65 | !end for |
|---|
| 66 | |
|---|
| 67 | |
|---|
| 68 | !set %subclasses = %clas["subs"] |
|---|
| 69 | !for %sub in %subclasses |
|---|
| 70 | {%sub["class_name"] = %sub["poll"]} |
|---|
| 71 | !if %sub["interval"]: |
|---|
| 72 | interval = %sub["interval"] |
|---|
| 73 | !end if |
|---|
| 74 | !if %sub["cf"]: |
|---|
| 75 | cf = %sub["cf"] |
|---|
| 76 | !end if |
|---|
| 77 | !if %sub["archive"]: |
|---|
| 78 | archive = %sub["archive"] |
|---|
| 79 | !end if |
|---|
| 80 | |
|---|
| 81 | !for %var in %sub["variables"] |
|---|
| 82 | %var["name"]:poll = %var["poll"] |
|---|
| 83 | %var["name"]:type = %var["type"] |
|---|
| 84 | !if %var["type"] == "GAUGE" and %var["min"] != '': |
|---|
| 85 | %var["name"]:min = %var["min"] |
|---|
| 86 | !end if |
|---|
| 87 | !if %var["type"] == "GAUGE" and %var["max"] != '': |
|---|
| 88 | %var["name"]:max = %var["max"] |
|---|
| 89 | !end if |
|---|
| 90 | |
|---|
| 91 | !end for |
|---|
| 92 | !end for |
|---|
| 93 | |
|---|
| 94 | !end for |
|---|