Replies: 4 comments 9 replies
-
I have reconfirmed this issue with Pak @ariya , and my confirmation has a firm my stand on how we should do this technically. There are few reason why we should do the later approach.
|
Beta Was this translation helpful? Give feedback.
-
An example config will be like the following: {
"agents": [
{
"name": "Surabaya",
"ip": "192.168.1.101",
"username": "monika",
"password": "trustno1"
}
],
"probes": [
{
"name": "Google",
"description": "Check if Google is down or not",
"interval": 60,
"method": "GET",
"timeout": 5,
"requests": [
{
"url": "https://google.com"
}
],
"agents": [
"local",
"Surabaya"
]
}
]
} Here the probe named Google will be executed on two places, local (a special one) and Surabaya. The latter refers to the chosen agent name specified in the The example illustrates the use username/password for authentication but obviously at some point we ought to support SSL certificate. Also for the time being, we can assume that the remote machine has cURL installed already. |
Beta Was this translation helpful? Give feedback.
-
Isn't this feature supposed to be the job of symon? not monika? |
Beta Was this translation helpful? Give feedback.
-
As POC, the following script should be imitated by monika probing. #!/bin/bash
while getopts h:i:p: flag
do
case "${flag}" in
h) HOST=${OPTARG};;
i) SSH_KEY=${OPTARG};;
p) PROBE_TARGET=${OPTARG};;
esac
done
if [ -z $HOST ] || [ -z $SSH_KEY ] || [ -z $PROBE_TARGET ]; then
echo "Usage"
echo " -h SSH user@host target"
echo " -i Path to SSH private key or PEM"
echo " -p URL to proble"
echo "Example"
echo " $0 -h user@myhost -i /path/to/key.pem -p https://check.com"
exit 1
fi
if [ ! -r $SSH_KEY ]; then
echo "SSH Key not found"
exit 1
fi
ssh -i $SSH_KEY $HOST bash -c "'
if [ -f arguments.txt ]; then
rm arguments.txt
fi
# https://curl.se/docs/manpage.html
echo "{\\\\n" > arguments.txt
echo "\"monika_http_code\": %{http_code}\\\\n" >> arguments.txt
echo "\"monika_time_total\": %{time_total} seconds\\\\n" >> arguments.txt
echo "\"monika_size_request\": %{size_request} bytes\\\\n" >> arguments.txt
echo "\"monika_size_download\": %{size_download} bytes\\\\n" >> arguments.txt
echo "}\\\\n" >> arguments.txt
if [ -f detail.txt ]; then
rm detail.txt
fi
if [ -f headers.txt ]; then
rm headers.txt
fi
if [ -f output.txt ]; then
rm output.txt
fi
curl -s --dump-header headers.txt -w "@arguments.txt" $PROBE_TARGET > detail.txt
echo "[response-detail]"
cat detail.txt | grep "monika"
echo "[response-headers]"
cat headers.txt
'" save the script above as
|
Beta Was this translation helpful? Give feedback.
-
Describe the bug
Currently monika only able to run from local agent, we want monika to also run from remote agent as in the symon original idea.
By running remote agent we can try multiple host or region for monitoring.
To Reproduce
Steps to reproduce the behavior:
Currently the monitoring from Monika is only run from the local agent, checking the url set in probe.
Expected behavior
Monika can run the checking to the url from agent deployed in remote servers.
Beta Was this translation helpful? Give feedback.
All reactions