neeladevi / nagioschecker

Automatically exported from code.google.com/p/nagioschecker
0 stars 0 forks source link

Problem when detecting status.cgi #163

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Add a new Nagios system
2. In the Status of URL script, click on Locate the URL
3. It goes in infinite loop

What is the expected output? What do you see instead?

It should detect the status.cgi url.

After tracking the problem, it's a simple bug:
in nagioschecker-new.js, downloadStatus is called with 4 parameters:

      parser.downloadStatus(document.getElementById('nch-general-url').value,document.getElementById('nch-general-username').value,document.getElementById('nch-general-password').value,function(urlst) {

in nagioschecker-parser.js, only the first 3 parameters are taken into account:
  downloadStatus: function(url,server,callback) {

Notice that a string is used instead of the callback routine !!!

Original issue reported on code.google.com by jcmeyrig...@gmail.com on 10 Aug 2010 at 8:52

GoogleCodeExporter commented 8 years ago
Suggested fix, in nagioschecker-new.js, replace the call by:

      parser.downloadStatus(document.getElementById('nch-general-url').value,
      {
          username:document.getElementById('nch-general-username').value,
          password:document.getElementById('nch-general-password').value
      }
      ,function(urlst) {

Original comment by jcmeyrig...@gmail.com on 10 Aug 2010 at 8:59

GoogleCodeExporter commented 8 years ago
Small hint: use jslint.com to validate the javascript source.

Original comment by jcmeyrig...@gmail.com on 10 Aug 2010 at 9:13