I thought it's better to start a new thread out of https://www.zabbix.com/forum/showthread.php?t=10661
I would like to monitor a Rails application that uses a simple authentication with username and password and the common Rails security feature authenticity_token which is a hidden field and contains a hash that is generated automatically with every website visit.
I managed to extract the token with a relative new feature on our Zabbix 2.2.5 server system:
But sometimes (not everytime) the login step in the web scenario fails if there are special characters in the hash....
my variable definition:
my post:
Rails Log:
=> Can you see the whitespace in the authenticity_token in the logfile ? I think but I'm not sure the website is giving the token hash in a format that can not be stored in a variable. Might be a special character like % or has something to to with url encoding...
How do I get out of this ? I'm not a regex expert but I think it's correct for my goal.
I would like to monitor a Rails application that uses a simple authentication with username and password and the common Rails security feature authenticity_token which is a hidden field and contains a hash that is generated automatically with every website visit.
I managed to extract the token with a relative new feature on our Zabbix 2.2.5 server system:
But sometimes (not everytime) the login step in the web scenario fails if there are special characters in the hash....
my variable definition:
Code:
{token}=regex:input name="authenticity_token" type="hidden" value="(.{44})"
Code:
authenticity_token={token}
Code:
Started POST "/login" for x.x.x.x at 2014-08-13 10:01:19 +0200
Processing by AccountController#login as */*
Parameters: {"utf8"=>"✓", "back_url"=>"https://bla.bla.bla/", "authenticity_token"=>"DczPoEpy0I/Aojo9AF7W0LnqW2yt1 pmVm2nbIzdnQc=", "username"=>"zabbix", "password"=>"[FILTERED]", "login"=>"Anmelden »"}
WARNING: Can't verify CSRF token authenticity
Rendered common/error.html.erb within layouts/base (0.3ms)
Rendered plugins/redmine_banner/app/views/banner/_project_body_bottom.html.erb (0.0ms)
Filter chain halted as :verify_authenticity_token rendered or redirected
Completed 422 Unprocessable Entity in 10.7ms (Views: 9.1ms | ActiveRecord: 0.7ms)
How do I get out of this ? I'm not a regex expert but I think it's correct for my goal.
Comment