Scripts from non interactive vbash


#1

I have trouble getting a custom nrpe plugin to work. It works when I call it myself on the command line, but when it gets executed through nrpe, it doesn’t. The problem seems to be that the vyatta commands do work in a script running on an interactive shell, but not in scripts running on a non-interactive shell.

As a test I used the script in https://wiki.vyos.net/wiki/Command_scriptin:

[code]#!/bin/vbash
source /opt/vyatta/etc/functions/script-template

run show interfaces[/code]

This gets the correct result in a shell, but returns nothing to nrpe. Does anyone know what I should do differently?


#2

Solved it. The user nrpe was running under did not have permissions to use the show command.