كيفية إنشاء الأجهزة والأهداف
تتحقق مراقبة HTTP/S من عنوان URL واحد للتأكد من توفره وأدائه والمحتوى المناسب والأخطاء. وهو يدعم جميع الأنواع الشائعة من الطلبات وملفات تعريف الارتباط وعمليات إرسال النماذج والرؤوس المخصصة والمواقع الآمنة بكلمة مرور (تفويض HTTP / S الأساسي بالإضافة إلى آليات تفويض ملفات تعريف الارتباط / البرنامج النصي) وعتبات المهلة.
تقوم مراقبة HTTP/S بالتحقق من صحة شهادات الأمان والتحقق من المرجع المصدق وإجراء عمليات التحقق من انتهاء صلاحية الشهادة. يمكن تكوينه لإرسال تذكيرات إليك عند اقتراب تاريخ انتهاء صلاحية الشهادة.
يمكنك تحويل معلمات طلب HTTP (S) إلى معلمات السياق لتمرير القيم، على سبيل المثال، استردادها من استجابة لطلب آخر داخل جهاز المراقبة. يمكنك إعداد معلمات السياق لعنوان URL والرؤوس ونص الطلب وإعداد البرامج النصية / نشرها. للحصول على التفاصيل، راجع كيفية استخدام معلمات السياق في طلبات HTTP (الطلبات).
استيراد بالجملة
لإنشاء مراقبة للعديد من الأجهزة بنقرة واحدة، اختر خيار الاستيراد المجمع الذي يتم توفيره لنوع مراقبة HTTP/S في الصفحة تحديد نوع مراقبة . لمزيد من التفاصيل، يرجى الاطلاع على الاستيراد المجمع | مراقبة صفحة الويب ، HTTP / S ، ومقالة أجهزة PING / ICMP من الويكي.
تكوين طلب
عنوان URL
Enter the URL of the page you wish to perform the task on. It should be formatted as such: www.example.com. You can turn on a visually friendly input mode by clicking the Detailed switcher on the top of the section.
SSL/Certificate Check
Secure Socket Layer SSL Certificate Check is a standard aspect of HTTP(S) tests.
The following additional options are available:
- Authority: verifies whether a certificate chain contains a root certificate that is trusted, or not trusted.
- Common Name (CN): validates that an address you navigate to matches the address certificate the address was signed to.
- Date: verifies the certificate expiration date.
- Revocation: validates that the certificate’s chain of trust doesn’t contain a revoked certificate.
- Usage: verifies a certificate chain for the improper use of an intermediate certificate.
- Expiration Reminder in Days: a reminder that notifies (as an error) about certificate expiration.
- Client Certificate: client certificate name.
نوع الطلب
In the Request Type field, you can select one of the most-commonly-used HTTP methods to send monitoring requests to a web page. If you need to send a payload with HTTP requests, provide it in the corresponding field (see the Request Body chapter for details). The payload can be specified and sent with all types of requests except Trace (RFC2616).
راجع أيضا: اسم المضيف المستهدف أو عنوان IP.
عتبة التحقق من صحة الوقت (بالثواني)
أدخل الحد الأقصى لعدد الثواني التي يجب أن ينتظرها النظام للحصول على استجابة من صفحة الويب قبل إنهاء المهمة وإرجاع خطأ.
الحد الأقصى لقيمة المهلة يقتصر على 70 ثانية. إذا لم يتم تعيين الحد ، تطبيق مهلة 70 ثانية الافتراضية على المهمة.
عمليات إعادة توجيه عناوين URL
If the Follow Redirects option is set to Yes, the system will follow the path of the URL that is sent with the 301 response and consider each redirect as a separate HTTP request. It enables you to follow the full redirect chain (all the links the request is redirected through) in the test results, including response times both for the initial URL and subsequent responses.
We recommend that you leave the Follow Redirects option activated if you need to test not only the initial URL, but all the URLs in the chain. For example, it can be useful to perform an SSL certificate check for each URL in a redirect chain.
In cases where you want to test an initial URL only, disable the Follow Redirects option.
التحقق من صحة المحتوى
Content Validation Keywords are used to ensure that the expected content was loaded onto a web page. In the Keyword fields, you can specify one or more words or phrases that you wish to search for in the web page content. If the expected keywords are not found, the task will return an error.
You can enter multiple strings into the keyword fields. The values you enter can be separated by logical expressions as follows:
{[("keyword1"&"keyword2")|!"keyword3"]}
Where:
{[ – keyword expression start;
]} – keyword expression end;
() – grouping brackets;
& – logical AND;
| – logical OR;
! – logical NOT;
“string” – a keyword.
A successful keyword expression must include the start and end brackets as follows:
{["keyword"]}
إذن
The HTTP authentication protocol is used to allow users to access content on some websites.
The following authentication schemes are available:
- Basic Authentication: This method encodes the username and password in base64 and sends them in the request header. It’s simple but not secure unless used with HTTPS.
- Digest Authentication: This scheme hashes credentials using a nonce (a random value) before sending them over the network, providing better security than Basic Authentication by preventing replay attacks.
- NTLM Authentication: A challenge-response mechanism developed by Microsoft, NTLM is used for securing credentials in Windows environments. It provides strong security by using multiple hashing and challenge-response protocols.
Once provided, login credentials will be passed along with the request header to the web server.
- Username: contains a username for HTTP/S authentication.
- User Password: contains a password for HTTP/S authentication.
Do not confuse HTTP authentication with other authentication schemes such as Bearer Authentication that involves bearer tokens and OAuth 2.0 that uses access tokens.
Read the articles on Basic Authentication Username and Password and Monitoring OAuth 2.0-based APIs for more information.
رؤوس
يتيح الخيار إضافة أي رؤوس مخصصة إضافية. على سبيل المثال، يمكنك تحديد نوع MIME للبيانات المرسلة مع الطلب في رأس نوع المحتوى:
Content-Type: text/html
إذا لم يتم تحديد رأس نوع المحتوى للطلب، إرسال الطلب مع تطبيق نوع المحتوى الافتراضي /x-www-form-urlencoded.
نص الطلب
Dotcom-Monitor allows you to send payloads in HTTP(S) requests (except Trace requests). The content within the HTTP request body can be sent as “raw” data (JSON, XML, etc.) or static name-value collection (Form Data).
To work with a name-value collection, you can turn on the detailed input mode by using the Detailed switcher on the top of the section and provide request parameter names and values in the corresponding field.
To send “raw” data along with the request, such as a JSON object, enter your JSON payload in the input field. You can also dynamically change the request body. For example, if you need to send the current date and time as a part of your POST request or pass the current session ID in JSON payload to a remote server. Dotcom-Monitor enables dynamically changing HTTP request payload by using the Razor syntax and data masks.
-
Example. Dynamic JSON Body for HTTP Post Requests
To better understand how Dynamic JSON body works in the HTTP request, let’s have a look at the following example. Suppose we need to submit an order on a website and the submission transaction includes three basic steps executed sequentially:
- Login
- Check-in
- Order Submission
To set up a test with these steps executed sequentially, we need to create three HTTP tasks within one monitoring device (or load test, if load testing is taking place).
Let’s assume that we need to send the current time and a unique GUID in the JSON with the HTTP request to check in with the application. Also, to submit an order, a user session ID generated upon login and an order time is required by the application.
To implement this test, we first need to configure a login request with basic authentication parameters to the web application web server. Next, we need to configure an HTTP request to pass the actual check-in time and unique GUID along with a JSON body. For this example, we will enter the following string using the Razor syntax in the JSON body:
{ "CheckInTime": "@Model["CurrentTime"]", "GenGuid": "@Model["Guid"]" }
Where @Model[“<Parameter Name>”] references a necessary context parameter name in the Razor expression.
We must declare the context parameters and specify how the Post Data should be processed in the Prepare Script field:
context.Guid = Guid.NewGuid().ToString(); // uniq random string context.CurrentTime = DateTime.Now.ToUniversalTime().ToString("yyyy-MM-dd\\Thh:mm:ss") + ".0Z"; // get current time in UTC ProcessPostDataByRazor(currentTask); // the call to process the Post Data content with the Razor engine
The result HTTP request will look similar to this:
03:15:23 POST https://www.dotcom-monitor.com/CheckIn { "CheckInTime": "2021-03-30T08:15:22.0Z", "GenGuid": "5c5e3d23-66fd-49d0-bd57-62c516aea7e7" }
In the next step, we need to configure the HTTP request to submit an order. In order to do this, we will pass the order current time and session ID, along with the item’s model identification number, in the JSON body to the target endpoint. See the JSON body for this request below:
{ "OrderTime": "@Model["OrderTime"]", "VIEWSTATE": "@Model["Session"]", "ModelID": "2128506" }
To pass a value of the current session ID variable, we need to retrieve it from the login page, called at the first login step, using the View State method. It can be coded in the prepare script. Additionally, to simulate a real user’s think time, we will set the order time variable with a three minute offset. Therefore, the Prepare Script field will contain the following strings:
context.OrderTime = DateTime.Now.AddMinutes(3).ToUniversalTime().ToString("yyyy-MM-dd\\Thh:mm:ss") + ".0Z"; // order time + 3 min context.Session = (Tasks["Login"] as Http).body["//INPUT[@ID='__VIEWSTATE']", "VALUE"]; // track state value from Login page ProcessPostDataByRazor(currentTask);
The resulting HTTP request will look similar to this:
03:15:45 POST https://www.dotcom-monitor.com/Order { "OrderTime": "2021-03-30T08:18:45.0Z", "VIEWSTATE": "<Server Generated ViewState>", "ModelID": "2128506" }
To learn how to configure an HTTP request with a dynamically changing payload, see How to Dynamically Change Payload in HTTP Request.
خيارات DNS
تتيح ميزة خيارات DNS للمستخدمين اختيار كيفية إجراء طلبات خادم اسم المجال (DNS) أثناء مهمة المراقبة.
لتحديد وضع حل أسماء المضيفين، في القسم وضع حل DNS ، حدد أحد الأوضاع المتوفرة. لمزيد من التفاصيل حول تكوين الميزة، راجع خيارات وضع DNS.
يسمح قسم مضيفات DNS المخصصة بإعداد تعيين عناوين IP لأسماء المضيفين. يتم دعم دقة DNS IPv6 و IPv4.
لتحديد التعيين، أدخل عنوان IP واسم المضيف في الحقول المقابلة.
راجع أيضا: خيارات وضع DNS.
إعداد البرنامج النصي والبرنامج النصي اللاحق
The fields can contain C# code, which can be used for specific POST, GET, URL data or for validating or publishing custom headers. Please see the Using Prepare Script and Post Script article or contact technical support for more details on usage.