Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
I
Imldeployment
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
IML Open Source
Imldeployment
Commits
d6ad02d0
Commit
d6ad02d0
authored
1 year ago
by
Hahn Axel (hahn)
Browse files
Options
Downloads
Patches
Plain Diff
update appmonitor client check httpcontent
parent
ddfa7722
No related branches found
No related tags found
1 merge request
!52
6421 update appmonitor checks
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
public_html/appmonitor/plugins/checks/httpcontent.php
+6
-0
6 additions, 0 deletions
public_html/appmonitor/plugins/checks/httpcontent.php
with
6 additions
and
0 deletions
public_html/appmonitor/plugins/checks/httpcontent.php
+
6
−
0
View file @
d6ad02d0
...
@@ -19,6 +19,7 @@
...
@@ -19,6 +19,7 @@
*
*
* 2021-10-26 <axel.hahn@iml.unibe.ch>
* 2021-10-26 <axel.hahn@iml.unibe.ch>
* 2022-12-21 <axel.hahn@unibe.ch> add flag sslverify
* 2022-12-21 <axel.hahn@unibe.ch> add flag sslverify
* 2023-07-06 <axel.hahn@unibe.ch> add flag userpwd
*
*
*/
*/
class
checkHttpContent
extends
appmonitorcheck
{
class
checkHttpContent
extends
appmonitorcheck
{
...
@@ -40,6 +41,7 @@ class checkHttpContent extends appmonitorcheck{
...
@@ -40,6 +41,7 @@ class checkHttpContent extends appmonitorcheck{
* @param array $aParams
* @param array $aParams
* [
* [
* url string url to fetch
* url string url to fetch
* userpwd string set user and password; syntax: "[username]:[password]"
* timeout integer optional timeout in sec; default: 5
* timeout integer optional timeout in sec; default: 5
* headeronly boolean optional flag to fetch http response herader only; default: false = returns header and body
* headeronly boolean optional flag to fetch http response herader only; default: false = returns header and body
* follow boolean optional flag to follow a location; default: false = do not follow
* follow boolean optional flag to follow a location; default: false = do not follow
...
@@ -68,6 +70,10 @@ class checkHttpContent extends appmonitorcheck{
...
@@ -68,6 +70,10 @@ class checkHttpContent extends appmonitorcheck{
curl_setopt
(
$ch
,
CURLOPT_RETURNTRANSFER
,
1
);
curl_setopt
(
$ch
,
CURLOPT_RETURNTRANSFER
,
1
);
curl_setopt
(
$ch
,
CURLOPT_SSL_VERIFYPEER
,
isset
(
$aParams
[
"sslverify"
])
?
!!
$aParams
[
"sslverify"
]
:
1
);
curl_setopt
(
$ch
,
CURLOPT_SSL_VERIFYPEER
,
isset
(
$aParams
[
"sslverify"
])
?
!!
$aParams
[
"sslverify"
]
:
1
);
curl_setopt
(
$ch
,
CURLOPT_TIMEOUT
,
(
isset
(
$aParams
[
"timeout"
])
&&
(
int
)
$aParams
[
"timeout"
])
?
(
int
)
$aParams
[
"timeout"
]
:
$this
->
_iTimeoutTcp
);
curl_setopt
(
$ch
,
CURLOPT_TIMEOUT
,
(
isset
(
$aParams
[
"timeout"
])
&&
(
int
)
$aParams
[
"timeout"
])
?
(
int
)
$aParams
[
"timeout"
]
:
$this
->
_iTimeoutTcp
);
if
(
isset
(
$aParams
[
"userpwd"
])){
curl_setopt
(
$ch
,
CURLOPT_USERPWD
,
$aParams
[
"userpwd"
]);
}
$res
=
curl_exec
(
$ch
);
$res
=
curl_exec
(
$ch
);
if
(
!
$res
)
{
if
(
!
$res
)
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment