Hello,
asemon_logger can't connect to the monitored server in my office, I think a test is wrong in the asemon_logger code :
# su - sybase -c "isql -SMONITORED_ASE -Usa -p"
1> sp_role 'grant', mon_role, login_asemon
2> go
All the roles specified to be granted in the grant role statement have already
been granted to grantee 'login_asemon'.
Authorization updated.
(return status = 0)
Execution Time (ms.): 2 Clock Time (ms.): 2
1> exit
# su - sybase -c "isql -SMAESTRIA -Ulogin_asemon -p"
1> select proc_role('mon_role')
2> go
-----------
2
(1 row affected)
Execution Time (ms.): 1 Clock Time (ms.): 2
1> exit
# ./start_asemon_logger
[...]
2013/05/16 18:38:35.437 main - Connected to archive server : ARCHIVE_ASE Database : asemon
2013/05/16 18:38:35.440 main - Try to connect to srv : MONITORED_ASE
2013/05/16 18:38:35.440 main - Srv found in interfaces or SQL.INI file. Host=MONITORED_ASE Port=5000
For monitored server 'MONITORED_ASE', user 'login_asemon' - Password ?
2013/05/16 18:39:03.968 main - Password added in passwords file for 'MONITORED_ASE.login_asemon'
2013/05/16 18:39:04.232 main - connectMonitoredASE - connected to : MONITORED_ASE Version : 1550
2013/05/16 18:39:04.233 main - Time difference (ms) between ASE and asemon_logger (positive when ASE is in advance) : -25
2013/05/16 18:39:04.234 main - connectMonitoredASE : 'mon_role' missing for user 'login_asemon'
2013/05/16 18:39:04.235 main - Password removed from passwords file for 'MONITORED_ASE.login_asemon'
I see that in src/asemon_logger/CnxMgr.java there is this test :
if (msrv.mon_role != 1) {
Asemon_logger.printmess ("connectMonitoredASE : 'mon_role' missing for user '"+msrv.user+"'");
[...]
return false;
}
While the Sybase documentation for proc_role at http://infocenter.sybase.com/help/index.jsp?topic=/com.sybase.help.ase_15.0.blocks/html/blocks/blocks188.htm says :
proc_role returns 0 if the user has:
Not been granted the specified role
Not been granted a role which contains the specified role
Been granted, but has not activated, the specified role
proc_role returns 1 if the invoking user has been granted, and has activated, the specified role.
proc_role returns 2 if the invoking user has a currently active role, which contains the specified role.
So you should check msrv.mon_role == 0.
Olivier Smedts (olivier at gid0 org)
Anonymous
I agree, I fixed this in V2.7.10