Show command used
Show command used
I don't want to give someone permission to see CCM but would be very useful for them to see the command used. In their old Nagios Core with Thruk it was shown on the Host status and service status pages. I just added the object config component btu it just shows the command name and the ARG fields. Anyone ever make something to show the actually full commandline command used?
2 of XI5.6.14 Prod/DR/DEV - Nagios LogServer 2 Nodes
See my projects on the Exchange at BanditBBS - Also check out my Nagios stuff on my personal page at Bandit's Home and at github
See my projects on the Exchange at BanditBBS - Also check out my Nagios stuff on my personal page at Bandit's Home and at github
Re: Show command used
You could probably use the Actions component to call a script that would return that info but I'm unaware of anything currently that would do it.
Re: Show command used
Yeah, I could easily make a component that adds another tab too, my issue is how to build the commandline. Is there a call in the XI code that I can make? I've just never messed with building the commandline used...
2 of XI5.6.14 Prod/DR/DEV - Nagios LogServer 2 Nodes
See my projects on the Exchange at BanditBBS - Also check out my Nagios stuff on my personal page at Bandit's Home and at github
See my projects on the Exchange at BanditBBS - Also check out my Nagios stuff on my personal page at Bandit's Home and at github
Re: Show command used
In XI, you can use the API to get the Host or Service configs in json format and then use that in your script to parse it for the user.
This is an example of the command you would use.
This is the output of one of the services on my test system.
That should get you closer to what you need.
You need to run XI 5.6.x to get this feature.
Check the Help > API Docs > Config Reference menu for more details.
This is an example of the command you would use.
Code: Select all
curl -XGET "https://xxx.xxx.xxx.xxx/nagiosxi/api/v1/config/service?apikey=<APIKEY>&pretty=1" -k
Code: Select all
{
"config_name": "Ubuntu",
"host_name": [
"Ubuntu"
],
"service_description": "Negate NRPE",
"use": [
"generic-service"
],
"check_command": "negate_nrpe!60%!8%!-C -w 50% -c 3% -r \/boot!!!!!",
"max_check_attempts": "5",
"check_interval": "5",
"retry_interval": "1",
"check_period": "xi_timeperiod_24x7",
"notification_interval": "60",
"notification_period": "xi_timeperiod_24x7",
"notifications_enabled": "0",
"contacts": [
"nagiosadmin"
],
"_xiwizard": "nrpe",
"register": "1"
},
You need to run XI 5.6.x to get this feature.
Check the Help > API Docs > Config Reference menu for more details.
Be sure to check out our Knowledgebase for helpful articles and solutions!