does anyone know how to pass parameters to a function?
I’d like to write a single custom function (e.g.: disk_free_space) and pass to it a parameter, in order to use it into different probes using different values:
a) Probe: server_disk_warning
disk_free_space(2000)
b) Probe: server_disk_alert
disk_free_space(500)
In probe a) I would set the limit threshold to 2000 MB, in probe b) to 500.
Does anybody know if that’s possible and eventually some sample to share the syntax to use into the function?
I wonder how can I avoid writing hundreds of functions and probes, all identical except for silly parameters like disk label (C, D, /var…), threshold (100, 1000…) and so on.
I’m also keen to be able to pass parameters into a function that I have written. It seems that this should be possible as many of the built-in functions can accept input parameters. Just that this capability is not exposed (or not documented) for user functions.
Also global variables can be used to pass parameters.
I think what you are referring to here is ROS functions - Not Dude functions. If I’m wrong, can you please advise how to pass a parameter into a user created Dude function?