Not a customer? Click the 'Start a free trial' link to begin a 30-day SaaS trial of our product and to join our community.
Existing Cisco AppDynamics customers should click the 'Sign In' button to authenticate to access the community
on 01-16-2025 11:17 AM
Monitoring URLs are an important part of your FullStackMonitoring.
Splunk AppDynamics lets you monitor URLs with different authentication. In this article, we will create a simple URL with a username and password. Afterwards, we will monitor it using AppDynamics Machine Agent.
pip install flask
basic_auth_api.py
:from flask import Flask, request, jsonify
from flask_httpauth import HTTPBasicAuth
app = Flask(__name__)
auth = HTTPBasicAuth()
# Dummy users for authentication
users = {
"user1": "password123",
"user2": "securepassword",
}
@auth.get_password
def get_pw(username):
return users.get(username)
@app.route('/api/data', methods=['GET'])
@auth.login_required
def get_data():
return jsonify({"message": f"Hello, {auth.username()}! Here is your data."})
if __name__ == '__main__':
app.run(debug=True, port=5000)
python basic_auth_api.py
curl
to access the API:curl -u user1:password123 http://127.0.0.1:5000/api/data
{
"message": "Hello, user1! Here is your data."
}
You can install the Machine agent as recommended here
git clone https://github.com/Appdynamics/url-monitoring-extension.git
cd url-monitoring-extension
Java 8
to build the extension artifact from the source. mvn -v
or mvn --version
. mvn clean install
cd target/
mv UrlMonitor-2.2.1.zip /opt/appdynamics/machine-agent/monitors
unzip UrlMonitor-2.2.1.zip
sites:
- name: AppDynamics
url: http://127.0.0.1:5000/api/data
username: user1
password: password123
authType: BASIC
metricPrefix: "Custom Metrics|URL Monitor|"
Thanks Abhi! I love the content and cookbook style of the documentation.
Thank you! Your submission has been received!
Thank you! Your submission has been received!
Oops! Something went wrong while submitting the form