How to automate zabbix web scenarios for vhosts?Deployment and monitoring tools for java/tomcat/linux environmentIs Zabbix the right tool for me?Monitor RESTful API Web Service with Zabbixzabbix 2.2.1 no graphs in Web scenarioZabbix web monitoring - storing responseZabbix installed from package, but no SNMP or Web Scenarios?Zabbix web steps for Angular single page appHow do I configure web scenario dependencies using zabbix?How to monitor HTTP URLs by Zabbix agentsZabbix - Web scenarios trigger. How to ignore the first failed attempts?
Why is Colorado so different politically from nearby states?
Topological spaces which are not pseudometrizable.
Self referencing scalar function nesting level exceeded when adding a select
Why is there a need to modify system call tables in Linux?
Sucuri detects malware on wordpress but I can't find the malicious code
What if you don't bring your credit card or debit for incidentals?
Plot Taylor–Couette flow ilustratation plot
The qvolume of an integer
Benefits of employing devices that support vlan trunking
Humans meet a distant alien species. How do they standardize? - Units of Measure
Is this cancel button needed?
Can a magnetic field of a large body be stronger than its gravity?
The term for the person/group a political party aligns themselves with to appear concerned about the general public
When leasing/renting out an owned property, is there a standard ratio between monthly rent and the mortgage?
How is it possible for Mordenkainen to be alive during the Curse of Strahd adventure?
Restoring order in a deck of playing cards (II)
What is the best option to connect old computer to modern TV
California: "For quality assurance, this phone call is being recorded"
Is there a term for this?
Why were the Night's Watch required to be celibate?
Replace value with the value of nearest neighbor in Pandas dataframe
Filling region bounded by multiple paths
Rotated Position of Integers
Can you please explain this joke: "I'm going bananas is what I tell my bananas before I leave the house"?
How to automate zabbix web scenarios for vhosts?
Deployment and monitoring tools for java/tomcat/linux environmentIs Zabbix the right tool for me?Monitor RESTful API Web Service with Zabbixzabbix 2.2.1 no graphs in Web scenarioZabbix web monitoring - storing responseZabbix installed from package, but no SNMP or Web Scenarios?Zabbix web steps for Angular single page appHow do I configure web scenario dependencies using zabbix?How to monitor HTTP URLs by Zabbix agentsZabbix - Web scenarios trigger. How to ignore the first failed attempts?
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty height:90px;width:728px;box-sizing:border-box;
I'm new to Zabbix and enterprise monitoring. I've just finished installing Zabbix 2.4.
I'm trying to monitor the state of all our vhosts dislocated on different servers.
Until now the only solution I came up with is to manually add a Web scenario to the Zabbix Server host for each vhost I want to monitor. But it's not so handy.
Searching around I have found a forum thread with a partial functioning idea: Using a template that reads from the target server all the vhosts (through a macro) and creates a Web scenario for each vhost.
EDIT: This solution (based on Zabbix 2.2) doesn't work because is not possible to use LLD (Low Level Discovery) with Web scenarios.
There is a Feature Request open since Nov 14 to implement LLD on Web scenarios.
QUESTION
The question is if there is some solution or suggestion on how to approach this kind of monitoring while waiting the feature implementation, or maybe my approach is totally wrong.
linux monitoring virtualhost zabbix
|
show 2 more comments
I'm new to Zabbix and enterprise monitoring. I've just finished installing Zabbix 2.4.
I'm trying to monitor the state of all our vhosts dislocated on different servers.
Until now the only solution I came up with is to manually add a Web scenario to the Zabbix Server host for each vhost I want to monitor. But it's not so handy.
Searching around I have found a forum thread with a partial functioning idea: Using a template that reads from the target server all the vhosts (through a macro) and creates a Web scenario for each vhost.
EDIT: This solution (based on Zabbix 2.2) doesn't work because is not possible to use LLD (Low Level Discovery) with Web scenarios.
There is a Feature Request open since Nov 14 to implement LLD on Web scenarios.
QUESTION
The question is if there is some solution or suggestion on how to approach this kind of monitoring while waiting the feature implementation, or maybe my approach is totally wrong.
linux monitoring virtualhost zabbix
1
According to the manual, you should be able to use template for web scenarios already in 2.2.
– StephenKing
Jun 16 '15 at 15:31
You are right the problem is not due to the template creating web scenarios. The problem is that it's not possible to use LLD with "web scenarios".
– SharpEdge
Jun 17 '15 at 9:50
Thank you man, is so bad serverfault?
– SharpEdge
Jun 19 '15 at 11:07
As far as i know you can create your own custom low level discovery?
– Navern
Jun 19 '15 at 12:02
1
@peterh interestingly, of your spree of similar comments, most of them seem to be on well-received questions with well received answers.
– BE77Y
Jun 19 '15 at 15:03
|
show 2 more comments
I'm new to Zabbix and enterprise monitoring. I've just finished installing Zabbix 2.4.
I'm trying to monitor the state of all our vhosts dislocated on different servers.
Until now the only solution I came up with is to manually add a Web scenario to the Zabbix Server host for each vhost I want to monitor. But it's not so handy.
Searching around I have found a forum thread with a partial functioning idea: Using a template that reads from the target server all the vhosts (through a macro) and creates a Web scenario for each vhost.
EDIT: This solution (based on Zabbix 2.2) doesn't work because is not possible to use LLD (Low Level Discovery) with Web scenarios.
There is a Feature Request open since Nov 14 to implement LLD on Web scenarios.
QUESTION
The question is if there is some solution or suggestion on how to approach this kind of monitoring while waiting the feature implementation, or maybe my approach is totally wrong.
linux monitoring virtualhost zabbix
I'm new to Zabbix and enterprise monitoring. I've just finished installing Zabbix 2.4.
I'm trying to monitor the state of all our vhosts dislocated on different servers.
Until now the only solution I came up with is to manually add a Web scenario to the Zabbix Server host for each vhost I want to monitor. But it's not so handy.
Searching around I have found a forum thread with a partial functioning idea: Using a template that reads from the target server all the vhosts (through a macro) and creates a Web scenario for each vhost.
EDIT: This solution (based on Zabbix 2.2) doesn't work because is not possible to use LLD (Low Level Discovery) with Web scenarios.
There is a Feature Request open since Nov 14 to implement LLD on Web scenarios.
QUESTION
The question is if there is some solution or suggestion on how to approach this kind of monitoring while waiting the feature implementation, or maybe my approach is totally wrong.
linux monitoring virtualhost zabbix
linux monitoring virtualhost zabbix
edited Jun 19 '15 at 10:54
peterh
4,42992442
4,42992442
asked Jun 16 '15 at 10:57
SharpEdgeSharpEdge
1466
1466
1
According to the manual, you should be able to use template for web scenarios already in 2.2.
– StephenKing
Jun 16 '15 at 15:31
You are right the problem is not due to the template creating web scenarios. The problem is that it's not possible to use LLD with "web scenarios".
– SharpEdge
Jun 17 '15 at 9:50
Thank you man, is so bad serverfault?
– SharpEdge
Jun 19 '15 at 11:07
As far as i know you can create your own custom low level discovery?
– Navern
Jun 19 '15 at 12:02
1
@peterh interestingly, of your spree of similar comments, most of them seem to be on well-received questions with well received answers.
– BE77Y
Jun 19 '15 at 15:03
|
show 2 more comments
1
According to the manual, you should be able to use template for web scenarios already in 2.2.
– StephenKing
Jun 16 '15 at 15:31
You are right the problem is not due to the template creating web scenarios. The problem is that it's not possible to use LLD with "web scenarios".
– SharpEdge
Jun 17 '15 at 9:50
Thank you man, is so bad serverfault?
– SharpEdge
Jun 19 '15 at 11:07
As far as i know you can create your own custom low level discovery?
– Navern
Jun 19 '15 at 12:02
1
@peterh interestingly, of your spree of similar comments, most of them seem to be on well-received questions with well received answers.
– BE77Y
Jun 19 '15 at 15:03
1
1
According to the manual, you should be able to use template for web scenarios already in 2.2.
– StephenKing
Jun 16 '15 at 15:31
According to the manual, you should be able to use template for web scenarios already in 2.2.
– StephenKing
Jun 16 '15 at 15:31
You are right the problem is not due to the template creating web scenarios. The problem is that it's not possible to use LLD with "web scenarios".
– SharpEdge
Jun 17 '15 at 9:50
You are right the problem is not due to the template creating web scenarios. The problem is that it's not possible to use LLD with "web scenarios".
– SharpEdge
Jun 17 '15 at 9:50
Thank you man, is so bad serverfault?
– SharpEdge
Jun 19 '15 at 11:07
Thank you man, is so bad serverfault?
– SharpEdge
Jun 19 '15 at 11:07
As far as i know you can create your own custom low level discovery?
– Navern
Jun 19 '15 at 12:02
As far as i know you can create your own custom low level discovery?
– Navern
Jun 19 '15 at 12:02
1
1
@peterh interestingly, of your spree of similar comments, most of them seem to be on well-received questions with well received answers.
– BE77Y
Jun 19 '15 at 15:03
@peterh interestingly, of your spree of similar comments, most of them seem to be on well-received questions with well received answers.
– BE77Y
Jun 19 '15 at 15:03
|
show 2 more comments
2 Answers
2
active
oldest
votes
Here a script that maybe will help you. This script read a list with URL and create web scenario direct in the zabbix database.
add a comment |
i used a script which use the zabbix api to create the scenarios.
#!/bin/bash
read -s -p "Enter AdminAPI password: " password
response=$(curl "http://192.168.0.5:10052/api_jsonrpc.php" -H "Content-Type: application/json-rpc" --data @<(cat <<EOF
"jsonrpc": "2.0",
"method": "user.login",
"params":
"user": "AdminAPI",
"password": "$password"
,
"id": 1,
"auth": null
EOF
))
read token id <<<$(echo $response | jq -r '.result, .id')
while read -p "enter quit or an url for a new web scenario" url && [ $url != "quit" ]
do
shorturl=$(echo $url | sed 's:.*//::')
echo ---------
echo $token
echo $url
echo $shorturl
echo ---------
# the hostid is visible when you are on the host page on the zabbix interface
#le hostid est visible dans l'url de de la page du host sur zabbix ici bunsrv
curl "http://192.168.0.5:10052/api_jsonrpc.php" -H "Content-Type: application/json-rpc" --data @<(cat <<EOF
"jsonrpc": "2.0",
"method": "httptest.create",
"params":
"name": "$shorturl",
"hostid": "10120",
"steps": [
"name": "Homepage",
"url": "$url",
"status_codes": 200,
"no": 1
]
,
"auth": "$token",
"id": $id
EOF
)
done
and for the triggers :
curl "http://192.168.0.5:10052/api_jsonrpc.php" -H "Content-Type: application/json-rpc" --data @<(cat <<EOF
"jsonrpc": "2.0",
"method": "trigger.create",
"params": [
"description": "Web scenario $shorturl failed: ITEM.VALUE from HOST.NAME",
"expression": "BUNSRV:web.test.fail[$shorturl].last()<>0 and BUNSRV:web.test.error[$shorturl].strlen()>0",
"priority": "2"
],
"auth": "$token",
"id": $id
EOF
)
done
add a comment |
Your Answer
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "2"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fserverfault.com%2fquestions%2f699344%2fhow-to-automate-zabbix-web-scenarios-for-vhosts%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
Here a script that maybe will help you. This script read a list with URL and create web scenario direct in the zabbix database.
add a comment |
Here a script that maybe will help you. This script read a list with URL and create web scenario direct in the zabbix database.
add a comment |
Here a script that maybe will help you. This script read a list with URL and create web scenario direct in the zabbix database.
Here a script that maybe will help you. This script read a list with URL and create web scenario direct in the zabbix database.
answered Jun 1 '16 at 14:24
Joao VitorinoJoao Vitorino
13618
13618
add a comment |
add a comment |
i used a script which use the zabbix api to create the scenarios.
#!/bin/bash
read -s -p "Enter AdminAPI password: " password
response=$(curl "http://192.168.0.5:10052/api_jsonrpc.php" -H "Content-Type: application/json-rpc" --data @<(cat <<EOF
"jsonrpc": "2.0",
"method": "user.login",
"params":
"user": "AdminAPI",
"password": "$password"
,
"id": 1,
"auth": null
EOF
))
read token id <<<$(echo $response | jq -r '.result, .id')
while read -p "enter quit or an url for a new web scenario" url && [ $url != "quit" ]
do
shorturl=$(echo $url | sed 's:.*//::')
echo ---------
echo $token
echo $url
echo $shorturl
echo ---------
# the hostid is visible when you are on the host page on the zabbix interface
#le hostid est visible dans l'url de de la page du host sur zabbix ici bunsrv
curl "http://192.168.0.5:10052/api_jsonrpc.php" -H "Content-Type: application/json-rpc" --data @<(cat <<EOF
"jsonrpc": "2.0",
"method": "httptest.create",
"params":
"name": "$shorturl",
"hostid": "10120",
"steps": [
"name": "Homepage",
"url": "$url",
"status_codes": 200,
"no": 1
]
,
"auth": "$token",
"id": $id
EOF
)
done
and for the triggers :
curl "http://192.168.0.5:10052/api_jsonrpc.php" -H "Content-Type: application/json-rpc" --data @<(cat <<EOF
"jsonrpc": "2.0",
"method": "trigger.create",
"params": [
"description": "Web scenario $shorturl failed: ITEM.VALUE from HOST.NAME",
"expression": "BUNSRV:web.test.fail[$shorturl].last()<>0 and BUNSRV:web.test.error[$shorturl].strlen()>0",
"priority": "2"
],
"auth": "$token",
"id": $id
EOF
)
done
add a comment |
i used a script which use the zabbix api to create the scenarios.
#!/bin/bash
read -s -p "Enter AdminAPI password: " password
response=$(curl "http://192.168.0.5:10052/api_jsonrpc.php" -H "Content-Type: application/json-rpc" --data @<(cat <<EOF
"jsonrpc": "2.0",
"method": "user.login",
"params":
"user": "AdminAPI",
"password": "$password"
,
"id": 1,
"auth": null
EOF
))
read token id <<<$(echo $response | jq -r '.result, .id')
while read -p "enter quit or an url for a new web scenario" url && [ $url != "quit" ]
do
shorturl=$(echo $url | sed 's:.*//::')
echo ---------
echo $token
echo $url
echo $shorturl
echo ---------
# the hostid is visible when you are on the host page on the zabbix interface
#le hostid est visible dans l'url de de la page du host sur zabbix ici bunsrv
curl "http://192.168.0.5:10052/api_jsonrpc.php" -H "Content-Type: application/json-rpc" --data @<(cat <<EOF
"jsonrpc": "2.0",
"method": "httptest.create",
"params":
"name": "$shorturl",
"hostid": "10120",
"steps": [
"name": "Homepage",
"url": "$url",
"status_codes": 200,
"no": 1
]
,
"auth": "$token",
"id": $id
EOF
)
done
and for the triggers :
curl "http://192.168.0.5:10052/api_jsonrpc.php" -H "Content-Type: application/json-rpc" --data @<(cat <<EOF
"jsonrpc": "2.0",
"method": "trigger.create",
"params": [
"description": "Web scenario $shorturl failed: ITEM.VALUE from HOST.NAME",
"expression": "BUNSRV:web.test.fail[$shorturl].last()<>0 and BUNSRV:web.test.error[$shorturl].strlen()>0",
"priority": "2"
],
"auth": "$token",
"id": $id
EOF
)
done
add a comment |
i used a script which use the zabbix api to create the scenarios.
#!/bin/bash
read -s -p "Enter AdminAPI password: " password
response=$(curl "http://192.168.0.5:10052/api_jsonrpc.php" -H "Content-Type: application/json-rpc" --data @<(cat <<EOF
"jsonrpc": "2.0",
"method": "user.login",
"params":
"user": "AdminAPI",
"password": "$password"
,
"id": 1,
"auth": null
EOF
))
read token id <<<$(echo $response | jq -r '.result, .id')
while read -p "enter quit or an url for a new web scenario" url && [ $url != "quit" ]
do
shorturl=$(echo $url | sed 's:.*//::')
echo ---------
echo $token
echo $url
echo $shorturl
echo ---------
# the hostid is visible when you are on the host page on the zabbix interface
#le hostid est visible dans l'url de de la page du host sur zabbix ici bunsrv
curl "http://192.168.0.5:10052/api_jsonrpc.php" -H "Content-Type: application/json-rpc" --data @<(cat <<EOF
"jsonrpc": "2.0",
"method": "httptest.create",
"params":
"name": "$shorturl",
"hostid": "10120",
"steps": [
"name": "Homepage",
"url": "$url",
"status_codes": 200,
"no": 1
]
,
"auth": "$token",
"id": $id
EOF
)
done
and for the triggers :
curl "http://192.168.0.5:10052/api_jsonrpc.php" -H "Content-Type: application/json-rpc" --data @<(cat <<EOF
"jsonrpc": "2.0",
"method": "trigger.create",
"params": [
"description": "Web scenario $shorturl failed: ITEM.VALUE from HOST.NAME",
"expression": "BUNSRV:web.test.fail[$shorturl].last()<>0 and BUNSRV:web.test.error[$shorturl].strlen()>0",
"priority": "2"
],
"auth": "$token",
"id": $id
EOF
)
done
i used a script which use the zabbix api to create the scenarios.
#!/bin/bash
read -s -p "Enter AdminAPI password: " password
response=$(curl "http://192.168.0.5:10052/api_jsonrpc.php" -H "Content-Type: application/json-rpc" --data @<(cat <<EOF
"jsonrpc": "2.0",
"method": "user.login",
"params":
"user": "AdminAPI",
"password": "$password"
,
"id": 1,
"auth": null
EOF
))
read token id <<<$(echo $response | jq -r '.result, .id')
while read -p "enter quit or an url for a new web scenario" url && [ $url != "quit" ]
do
shorturl=$(echo $url | sed 's:.*//::')
echo ---------
echo $token
echo $url
echo $shorturl
echo ---------
# the hostid is visible when you are on the host page on the zabbix interface
#le hostid est visible dans l'url de de la page du host sur zabbix ici bunsrv
curl "http://192.168.0.5:10052/api_jsonrpc.php" -H "Content-Type: application/json-rpc" --data @<(cat <<EOF
"jsonrpc": "2.0",
"method": "httptest.create",
"params":
"name": "$shorturl",
"hostid": "10120",
"steps": [
"name": "Homepage",
"url": "$url",
"status_codes": 200,
"no": 1
]
,
"auth": "$token",
"id": $id
EOF
)
done
and for the triggers :
curl "http://192.168.0.5:10052/api_jsonrpc.php" -H "Content-Type: application/json-rpc" --data @<(cat <<EOF
"jsonrpc": "2.0",
"method": "trigger.create",
"params": [
"description": "Web scenario $shorturl failed: ITEM.VALUE from HOST.NAME",
"expression": "BUNSRV:web.test.fail[$shorturl].last()<>0 and BUNSRV:web.test.error[$shorturl].strlen()>0",
"priority": "2"
],
"auth": "$token",
"id": $id
EOF
)
done
answered Aug 23 '17 at 13:53
The_PinguThe_Pingu
61
61
add a comment |
add a comment |
Thanks for contributing an answer to Server Fault!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fserverfault.com%2fquestions%2f699344%2fhow-to-automate-zabbix-web-scenarios-for-vhosts%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
1
According to the manual, you should be able to use template for web scenarios already in 2.2.
– StephenKing
Jun 16 '15 at 15:31
You are right the problem is not due to the template creating web scenarios. The problem is that it's not possible to use LLD with "web scenarios".
– SharpEdge
Jun 17 '15 at 9:50
Thank you man, is so bad serverfault?
– SharpEdge
Jun 19 '15 at 11:07
As far as i know you can create your own custom low level discovery?
– Navern
Jun 19 '15 at 12:02
1
@peterh interestingly, of your spree of similar comments, most of them seem to be on well-received questions with well received answers.
– BE77Y
Jun 19 '15 at 15:03