Search found 4 matches

by hepe
Wed Jan 24, 2018 11:54 pm
Forum: Open Source Nagios Projects
Topic: How can I read an attribute value from a file in check_http
Replies: 8
Views: 3684

Re: How can I read an attribute value from a file in check_h

I had trouble, loading the environmental variable in the check command. Can you guide me on how I can update the command to use the environmental variable value?
by hepe
Tue Jan 16, 2018 10:56 pm
Forum: Open Source Nagios Projects
Topic: How can I read an attribute value from a file in check_http
Replies: 8
Views: 3684

Re: How can I read an attribute value from a file in check_h

@cdienger I am using the check_http plugin

Code: Select all

define command{
    command_name    check_get_https_with_args_with_access_token
    command_line    /usr/local/nagios/libexec/check_http -H $HOSTADDRESS$ -S -u $ARG1$ -k $USER8$ --method=GET
}
by hepe
Tue Jan 16, 2018 6:12 am
Forum: Open Source Nagios Projects
Topic: How can I read an attribute value from a file in check_http
Replies: 8
Views: 3684

Re: How can I read an attribute value from a file in check_h

Thanks for the reply. I manage to get it working. I need to refresh the access token every 60 mins. So I have scheduled a cron job to be run, every 55mins to retive a new access token and save it in resource.cfg as a $USER8$ macro. But it seems nagios caches the resource.cfg file. even the resource....
by hepe
Tue Dec 19, 2017 2:15 am
Forum: Open Source Nagios Projects
Topic: How can I read an attribute value from a file in check_http
Replies: 8
Views: 3684

How can I read an attribute value from a file in check_http

I have written a bash script to get the authorization header token to be written to the /usr/local/nagios/etc/resource.cfg file. The bash script works fine and in the resource.cfg the token value is saved as below, ACCESS_TOKEN="Authorization: Bearer 38255d19-724a-4e2c-b8bc-1234retff13" Wh...