Page 1 of 1

Plugin to Execute any OS Command I specify

Posted: Fri Aug 23, 2024 11:17 am
by gregbeyer
Hi, I'm looking for a plugin that I can use, or maybe modify, that will execute an arbitrary CLI command. We are a high performance computing shop, and we use a piece of software, Slurm, from SchedMD for scheduling compute jobs. Slurm installs CLI utilities that we use to manually check queues and jobs. I find no plugin for slurm on Exchange. I would like to run a couple of these slurm utilities as I would any Nagios check, and OK/Warn/Critical on output.

Has anyone else used a plugin in this context to execute a specific OS or application command available on a box? What plugin did you use? Thanks for any leads/ideas.

Re: Plugin to Execute any OS Command I specify

Posted: Fri Aug 23, 2024 2:23 pm
by danderson
Thanks for reaching out @gregbeyer,

Here are the development guidelines in case you are willing to write your own plugin for this.

To be honest, I think you could write a simple bash script that runs the command and makes sure the return code of the command conforms to the required return codes for the plugins.

What would be an example command you would want? What kind of information would you want from the plugin? I might be able to write a quick one.

Re: Plugin to Execute any OS Command I specify

Posted: Fri Aug 23, 2024 2:31 pm
by jmichaelson
I agree with danderson. You may want to have it be a slightly more complex script that takes the specific slurm command as a command line option and then everything else after that, so you only have one script to maintain. e.g.,

Code: Select all

./check_slurm subcommand option1 option2 option3.....

Re: Plugin to Execute any OS Command I specify

Posted: Fri Aug 23, 2024 2:36 pm
by ssunga