0

One of my tasks with Zabbix is to monitor the many web applications that I support and gather accurate response times, emulating the user-experience. I have attempted to implement my scenarios based on the Zabbix Web Scenario section in the manual, but I can't manage to get Zabbix to login to the page.

In the Zabbix tutorial, they are using the namefield in the HTML to designate where to enter the data. Zabbix page example
On my web applications, this field is present for entering the user name and password, but not for the login button.
My page example

How can I get Zabbix to login to these pages without the name field being present in the HTML code?

  • Zabbix manual uses http form field, which is defined by parameter "name" (and actual value of this parameter is also"name"). Your snippet doesn't contain name parameter, so it's not obvious which parameters are sent from the form. Could extend your snippet please and show everything between <form> and </form> tags please? – Jan Garaj May 28 '15 at 16:14
  • @JanGaraj Just updated with requested snippet :) – Evan Bechtol May 28 '15 at 16:17
  • The button is irrelevant. As shown in the docs, you specify the post variables directly. – Michael Hampton May 28 '15 at 16:31
  • @MichaelHampton So in the case represented in the picture below, what would I put for it to actually login? Currently I specify the username and password, but it does not login. – Evan Bechtol May 28 '15 at 16:43
  • 1
    If your web application does not require the value of the POST variable sent by the button for login, then you don't need to care about it. The best way here is to check your web application which POST variables it uses for login, and set those POST variables in Zabbix web scenario. – Tero Kilkanen May 28 '15 at 21:43
1

Ok, I solved the problem. As per the comments, the button was not actually necessary to submit the content. However, the value of the name field was required for the username and password to submit properly.
Name fields
The trick was to create a login step, with the URL that is called when the form is submitted (in my example it is the action of the form). You need to put your post variables in this step as well, following redirects of course. Action
For example, using the above pictures:

  • URL: https://www.example.com/nu
  • Post (using macros in Zabbix): userName={user}&passWord={password}

Then, I created the login check step, which searched for a string that is on the landing page, and received a status code of 200.

Once this is working, you know that you have logged in successfully. Be sure that after all steps you want Zabbix to take, you have it log out.

Thanks for all the help in comments!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.