So when you have a custom plugin and you run it locally you will get the correct output but when you call the same plugin from the remote server (nagiosadmin) the output will be wrong . This is a user permission issue on some files you specified in the plugin script .For eg : if your plugin script is opening a log file which is in a different folder and it then doesn’t have the correct permission to open that file . In most cases you will be running the plugin as root locally but from remote server the same plugin will be executed from a user level . For eg : In AWS EC2 , the command from the remote server is using the default user ‘ec2-user’ and if ‘ec2-user’ doesn’t have the permssion to read the files , it will end up in error like this . So you need to find out the correct user and try running the command locally from that user , say , if you run the command as ec2-user , you will then get the same output error which you see running from the remote server . You need to tweak the permission of that file which is then executable by the user . So make sure ec2-user is part of wheel group and the ownership of your plugin should be root:wheel and then any files mentioned in the plugin should have read and execute permission from ‘ec2-user’ .
Leave a Reply