Skip to content

Commit ae7ecf6

Browse files
committed
prepare readme for new version
1 parent 96f7893 commit ae7ecf6

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed

README.rst

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,20 @@ All the extra_args are options directly comming from curl manpage, you can use a
5656
with exception of -s, -o, -w as these are
5757
implicit added on the curl command line argument to format the output for this plugin.
5858

59+
Example usage with AzureAD oauth2
60+
=================================
61+
62+
When creating authentication with AzureAD oauth2, you need to create a client Application and Azure AD only applications:
63+
64+
https://apps.dev.microsoft.com/#/appList
65+
66+
Then use:
67+
68+
> curlnagios --url 'https://{yoururltotest}/api/path' --client_id 'unique-client-id' --scope 'https://{tenant}/unique-id-here-for-the-app/.default' --client_secret 'theclientoken' --grant_type 'client_credentials' --auth_url 'https://login.microsoftonline.com/{tenant}/oauth2/v2.0/token' --oauth2
69+
70+
Change {tenant} with your identifier and the unique id for client and for application.
71+
Add your client secret
72+
5973
Nagios config
6074
=============
6175

@@ -66,6 +80,10 @@ Example command::
6680
command_line /usr/local/bin/curlnagios --url='$ARG1$' --extra_args='$ARG2$'
6781
}
6882

83+
define command{
84+
command_name check_http_curl_azuread
85+
command_line /usr/local/bin/curlnagios --url='$ARG1$' --client_id '$ARG2$' --scope '$ARG3$' --client_secret '$ARG4$' --auth_url 'https://login.microsoftonline.com/$ARG5$/oauth2/v2.0/token' --oauth2 --extra_args='$ARG6$'
86+
}
6987

7088
Example service::
7189

@@ -89,6 +107,16 @@ Example service bypassing reverse proxy and dns and proxy server::
89107

90108
## In this way you can connect to some backend and pass with -H the host header to get and also ensure no proxy used to connect to url.
91109

110+
Example using azuread oauth2::
111+
112+
define service {
113+
host_name SERVERY
114+
service_description fqdn.backend1
115+
check_command check_http_curl_azuread!http://fqdn.site.name/api/xx!client-unique-id!https://{tenant}/unique-id-here-for-the-app/.default!client-secret-unique!tenant!some extra args if desired
116+
use generic-service
117+
notes Monitoring backend1 de of site fqdn.site.name
118+
}
119+
92120
You can use ansible role that already has the installation and command: https://github.com/CoffeeITWorks/ansible_nagios4_server_plugins
93121

94122
TODO

0 commit comments

Comments
 (0)