Hi Team,
Do we have option from nagiosxi that can we bring the data for custom configuration which are done in client side??
check_custom is defined in client side, we need for which server custom commands are defined.
All the custom configuration which are done in client we need full the details from nagios server.
For Ex:command[check_custom]=/usr/local/nagios/libexec/check_custom.sh
Custom configuration for the remote linux server
-
informatica
- Posts: 99
- Joined: Thu Jan 28, 2021 9:55 pm
Re: Custom configuration for the remote linux server
That functionality doesn't exist.
You could setup another service and write a plugin that would grep/output them, you can use this for example (feel free to modify it as needed):
You could setup another service and write a plugin that would grep/output them, you can use this for example (feel free to modify it as needed):
Code: Select all
#!/bin/bash
DEFINEDCOMMANDS=$(grep '^command\[' /usr/local/nagios/etc/nrpe.cfg /usr/local/nagios/etc/nrpe/*.cfg)
COMMANDCOUNT=$(echo "$DEFINEDCOMMANDS" | wc -l)
echo "OK - Total commands ($COMMANDCOUNT) | total_commands=$COMMANDCOUNT"
echo "$DEFINEDCOMMANDS"
exit 0-
informatica
- Posts: 99
- Joined: Thu Jan 28, 2021 9:55 pm
Re: Custom configuration for the remote linux server
thanks for that,
we need only commands which are defined in nrpe.cfg.
also couple of commands might be commented, we should exclude commented one and
we should exclude default commands which are in nrpe.cfg. Could you please help with this?
we need only commands which are defined in nrpe.cfg.
also couple of commands might be commented, we should exclude commented one and
we should exclude default commands which are in nrpe.cfg. Could you please help with this?
Re: Custom configuration for the remote linux server
It already excludes commented ones.
Since there are no default ones in the nrpe.cfg you can just use this:
If you would like additional functionality you will need to make the changes as we do not have the time to do it in support. I just whipped up that script to help you get started as an example.
Since there are no default ones in the nrpe.cfg you can just use this:
Code: Select all
#!/bin/bash
DEFINEDCOMMANDS=$(grep '^command\[' /usr/local/nagios/etc/nrpe.cfg)
COMMANDCOUNT=$(echo "$DEFINEDCOMMANDS" | wc -l)
echo "OK - Total commands ($COMMANDCOUNT) | total_commands=$COMMANDCOUNT"
echo "$DEFINEDCOMMANDS"
exit 0