ODBC SQL / Database Problem

davidryandavidryan
I am a new user of Servers Check and so please forgive me if I am doing something silly or have missed something obvious. In my organisation I have many individual machines running their own local database servers (Sybase) and I would like to use the ODBCSQL monitor to run some code on a machine to determine if the database is responding OK.



I have the connection setup as a DSN in ODBC Manager; lets call is MYDBSERVER. I had some trouble getting the database to respond using the standard template for Sybase Anywhere as we are running a different version, and so found it connected to the database fine by putting DSN=MYDBSERVER; in the ODBC Connection String dialog box.



I then have a table called tblattention, which among other columns contains the fields device, noticetype. When the noticetype field is a '6', there can only ever be one entry for an individual machine if it has failed, otherwise there will be no entry with noticetype = '6' for that machine.



I was hoping I could set up the SQL Statement for a rule to be: SELECT * FROM tblattention WHERE noticetype = '6', and then set the Field name to be DEVICE, and the Set status to down to be returned if the VALUE is EQUAL to 'the Machine Name to be Monitored' ie: MACHINE-A



When I set this up and click on Test Settings, it all seems to work fine - the testing settings window pops up, the Status is always OK (I think meaning it connected to the database properly), the error code is always blank, and if the machine has failed - the Value = the Machine name - ie: MACHINE-A, and it says quite correctly that it might be down etc..., and if it isn't failed, the value field is blank - also correctly as there is no entry in the table.



The problem, is that when the rule is saved and monitoring turned on for normal operation, it never says the status is OK, it says ?DOWN for the three tries, and then confirms it is DOWN! If I go into the settings and test it while it is saying ?DOWN, the test still works fine as above, but the status never comes back to OK.



I think the software looks great and would love to purchase it to monitor our >35 machines in this way, but need to try and work out why I can't get this to work - please let me know any ideas.



Many thanks,



David Ryan

Comments

  • AdministratorAdministrator
    The difference between the Test Settings and the Normal Monitoring is caused by the user under which the monitoring service runs. By nature the 2 ways of checking are 100% identical except for the Windows user account running the check



    By default a service runs under the local system account. This account often has no network access and as a result making it impossible to connect to a remote machine eg a database server.



    Try changing the service to run under a admin account.
This discussion has been closed.