Hi,
Running Ubuntu 18.04 compiled rsyslog 8.1903 with configure flags
--enable-generate-man-pages --enable-libdbi --enable-imptcp --enable-inet

Rsyslog.conf:
$template dbFormat,"insert into SystemEvents (Message, Facility,FromHost, 
Priority, DeviceReportedTime, ReceivedAt, InfoUnitID, SysLogTag) values 
('%msg%', %syslogfacility%, '%HOSTNAME%',%syslogpriority%, 
'%timereported:::date-mysql%', '%timegenerated:::date-mysql%', %iut%, 
'%syslogtag%')",stdsql

action(type="omlibdbi" driver="freetds" server="host.db.org"
                       uid="user" pwd="pwd" db="database" template="dbFormat")

I have an issue with connecting to a remote MS SQL in Azure environment with 
the omlibdbi plugin. Not sure if this is related to the driver itself or the 
plugin so please bear with me. Rsyslog returns this error when it attempts to 
connect:
Mar 13 14:23:51 ubuntu rsyslogd: db error (-3): -3: libdbi could not establish 
a connection  [v8.1903.0]
Mar 13 14:23:51 ubuntu rsyslogd: action 'action-8-omlibdbi' suspended (module 
'omlibdbi'), retry 0. There should be messages before this one giving the 
reason for suspension. [v8.1903.0 try https://www.rsyslog.com/e/2007 ]
Mar 13 14:23:51 ubuntu rsyslogd: action 'action-8-omlibdbi' suspended (module 
'omlibdbi'), next retry is Wed Mar 13 14:24:21 2019, retry nbr 0. There should 
be messages before this one giving the reason for suspension. [v8.1903.0 try 
https://www.rsyslog.com/e/2007 ]

I am able to connect to the server with isql and tsql using the DSN in 
freetds.conf and odbc.ini, e.g. tsql -S host.db.org -U user -D database

Now I have ran a strace on rsyslog and it reads the freetds.conf and also calls 
the dbd objects alright but it terminates abruptly after a while calling 
connect(...):
750  14:23:35 connect(4, {sa_family=AF_INET, sin_port=htons(1433), 
sin_addr=inet_addr("xx.yy.zz.ææ")}, 16) = -1 EINPROGRESS (Operation now in 
progress)
2750  14:23:35 poll([{fd=4, events=POLLOUT}, {fd=2, events=POLLIN}], 2, 
90000000) = 1 ([{fd=4, revents=POLLOUT}])
2750  14:23:51 getsockopt(4, SOL_SOCKET, SO_ERROR, [0], [4]) = 0
2750  14:23:51 getpid()                 = 2747
2750  14:23:51 poll([{fd=4, events=POLLOUT}, {fd=2, events=POLLIN}], 2, -1) = 1 
([{fd=4, revents=POLLOUT}])
2750  14:23:51 sendto(4, "\22\1\0:\0\0\0\0\0\0\32\0\6\1\0 
\0\1\2\0!\0\f\3\0-\0\4\4\0001\0"..., 58, MSG_NOSIGNAL, NULL, 0) = 58
2750  14:23:51 setsockopt(4, SOL_TCP, TCP_CORK, [0], 4) = 0
2750  14:23:51 setsockopt(4, SOL_TCP, TCP_CORK, [1], 4) = 0
2750  14:23:51 poll([{fd=4, events=POLLIN}, {fd=2, events=POLLIN}], 2, -1) = 1 
([{fd=4, revents=POLLIN}])
2750  14:23:51 recvfrom(4, "\4\1\0+\0\0\1\0", 8, MSG_NOSIGNAL, NULL, NULL) = 8
2750  14:23:51 poll([{fd=4, events=POLLIN}, {fd=2, events=POLLIN}], 2, -1) = 1 
([{fd=4, revents=POLLIN}])
2750  14:23:51 recvfrom(4, "\0\0\32\0\6\1\0 
\0\1\2\0!\0\1\3\0\"\0\0\4\0\"\0\1\377\f\0\4L\0\0"..., 35, MSG_NOSIGNAL, NULL, 
NULL) = 35
2750  14:23:51 getrusage(RUSAGE_THREAD, {ru_utime={tv_sec=0, tv_usec=5419}, 
ru_stime={tv_sec=0, tv_usec=0}, ...}) = 0
2750  14:23:51 getpid()                 = 2747
2750  14:23:51 
getrandom("\x93\x3f\x52\xac\x7e\x89\x5b\xff\x75\xce\x88\x5a\x60\x07\x26\xeb\x95\x72\x38\x48\x6a\xe7\xd4\x4e\x2b\xc6\xc9\xb0\x86\xf2\x28\x13",
 32, 0) = 32
2750  14:23:51 
getrandom("\xa6\x74\x41\xc4\x1b\xef\xc4\xbf\xee\x83\x71\x59\xe9\xf5\x11\x97\xb1\x5e\x08\x64\x86\x5f\xd4\x47\x81\x70\xf6\x9c\xd1\x6b\x9e\x6f",
 32, 0) = 32
2750  14:23:51 getrandom("\x66\xc2\x6c\x40\x51\x7e\x7a\x75", 8, 0) = 8
2750  14:23:51 mprotect(0x7f72c003e000, 16384, PROT_READ|PROT_WRITE) = 0
2750  14:23:51 poll([{fd=4, events=POLLOUT}, {fd=2, events=POLLIN}], 2, -1) = 1 
([{fd=4, revents=POLLOUT}])
2750  14:23:51 sendto(4, 
"\22\1\0\356\0\0\0\0\26\3\1\0\341\1\0\0\335\3\3\\\211\22\323\301\255\0362\370S\354\300\315"...,
 238, MSG_NOSIGNAL, NULL, 0) = 238
2750  14:23:51 setsockopt(4, SOL_TCP, TCP_CORK, [0], 4) = 0
2750  14:23:51 setsockopt(4, SOL_TCP, TCP_CORK, [1], 4) = 0
2750  14:23:51 poll([{fd=4, events=POLLIN}, {fd=2, events=POLLIN}], 2, -1) = 1 
([{fd=4, revents=POLLIN}])
2750  14:23:51 recvfrom(4, "\22\0\20\0\0\0\0\0", 8, MSG_NOSIGNAL, NULL, NULL) = 
8
2750  14:23:51 mprotect(0x7f72c0042000, 4096, PROT_READ|PROT_WRITE) = 0
2750  14:23:51 poll([{fd=4, events=POLLIN}, {fd=2, events=POLLIN}], 2, -1) = 1 
([{fd=4, revents=POLLIN}])
2750  14:23:51 recvfrom(4, 
"\26\3\3\26\264\2\0\0Q\3\3\\\211\22wV\30\312(S\214\1\37\253\216\330v\305\255\304q\367"...,
 4088, MSG_NOSIGNAL, NULL, NULL) = 4088
2750  14:23:51 mprotect(0x7f72c0043000, 20480, PROT_READ|PROT_WRITE) = 0
2750  14:23:51 poll([{fd=4, events=POLLIN}, {fd=2, events=POLLIN}], 2, -1) = 1 
([{fd=4, revents=POLLIN}])
2750  14:23:51 recvfrom(4, "\22\1\6\311\0\0\0\0", 8, MSG_NOSIGNAL, NULL, NULL) 
= 8
2750  14:23:51 poll([{fd=4, events=POLLIN}, {fd=2, events=POLLIN}], 2, -1) = 1 
([{fd=4, revents=POLLIN}])
2750  14:23:51 recvfrom(4, 
"\234\244:\4wn\376s\1\205\317\374\274\36\263\205\230n\377\310\1\274\261K\314T\273y\217\216\252\34"...,
 1729, MSG_NOSIGNAL, NULL, NULL) = 1729
2750  14:23:51 mprotect(0x7f72c0048000, 4096, PROT_READ|PROT_WRITE) = 0
2750  14:23:51 mprotect(0x7f72c0049000, 4096, PROT_READ|PROT_WRITE) = 0
2750  14:23:51 mprotect(0x7f72c004a000, 4096, PROT_READ|PROT_WRITE) = 0
2750  14:23:51 mprotect(0x7f72c004b000, 4096, PROT_READ|PROT_WRITE) = 0
2750  14:23:51 mprotect(0x7f72c004c000, 4096, PROT_READ|PROT_WRITE) = 0
2750  14:23:51 mprotect(0x7f72c004d000, 4096, PROT_READ|PROT_WRITE) = 0
2750  14:23:51 mprotect(0x7f72c004e000, 4096, PROT_READ|PROT_WRITE) = 0
2750  14:23:51 mprotect(0x7f72c004f000, 4096, PROT_READ|PROT_WRITE) = 0
2750  14:23:51 mprotect(0x7f72c0050000, 4096, PROT_READ|PROT_WRITE) = 0
2750  14:23:51 mprotect(0x7f72c0051000, 4096, PROT_READ|PROT_WRITE) = 0
2750  14:23:51 mprotect(0x7f72c0052000, 4096, PROT_READ|PROT_WRITE) = 0
2750  14:23:51 mprotect(0x7f72c0053000, 4096, PROT_READ|PROT_WRITE) = 0
2750  14:23:51 mprotect(0x7f72c0054000, 4096, PROT_READ|PROT_WRITE) = 0
2750  14:23:51 mprotect(0x7f72c0055000, 4096, PROT_READ|PROT_WRITE) = 0
2750  14:23:51 mprotect(0x7f72c0056000, 4096, PROT_READ|PROT_WRITE) = 0
2750  14:23:51 mprotect(0x7f72c0057000, 4096, PROT_READ|PROT_WRITE) = 0
2750  14:23:51 getrusage(RUSAGE_THREAD, {ru_utime={tv_sec=0, tv_usec=8125}, 
ru_stime={tv_sec=0, tv_usec=0}, ...}) = 0
2750  14:23:51 getpid()                 = 2747
2750  14:23:51 mprotect(0x7f72c0058000, 4096, PROT_READ|PROT_WRITE) = 0
2750  14:23:51 mprotect(0x7f72c0059000, 16384, PROT_READ|PROT_WRITE) = 0
2750  14:23:51 poll([{fd=4, events=POLLOUT}, {fd=2, events=POLLIN}], 2, -1) = 1 
([{fd=4, revents=POLLOUT}])
2750  14:23:51 sendto(4, 
"\22\1\0\206\0\0\0\0\26\3\3\0F\20\0\0BA\4\260\357M\300u\204E\311\25\253\225\324\234"...,
 134, MSG_NOSIGNAL, NULL, 0) = 134
2750  14:23:51 setsockopt(4, SOL_TCP, TCP_CORK, [0], 4) = 0
2750  14:23:51 setsockopt(4, SOL_TCP, TCP_CORK, [1], 4) = 0
2750  14:23:51 poll([{fd=4, events=POLLIN}, {fd=2, events=POLLIN}], 2, -1) = 1 
([{fd=4, revents=POLLIN}])
2750  14:23:51 recvfrom(4, "\22\1\0;\0\0\0\0", 8, MSG_NOSIGNAL, NULL, NULL) = 8
2750  14:23:51 poll([{fd=4, events=POLLIN}, {fd=2, events=POLLIN}], 2, -1) = 1 
([{fd=4, revents=POLLIN}])
2750  14:23:51 recvfrom(4, 
"\24\3\3\0\1\1\26\3\3\0(\0\0\0\0\0\0\0\0\344\204\320\210\214\2365\20\206\340\v\275\30"...,
 51, MSG_NOSIGNAL, NULL, NULL) = 51
2750  14:23:51 getpid()                 = 2747
2750  14:23:51 ioctl(4, SIOCGIFCONF, {ifc_len=1024 => 3 * sizeof(struct ifreq), 
ifc_buf=[{ifr_name="lo", ifr_addr={sa_family=AF_INET, sin_port=htons(0), 
sin_addr=inet_addr("127.0.0.1")}}, {ifr_name="enp0s3", 
ifr_addr={sa_family=AF_INET, sin_port=htons(0), 
sin_addr=inet_addr("10.0.2.15")}}, {ifr_name="enp0s8", 
ifr_addr={sa_family=AF_INET, sin_port=htons(0), 
sin_addr=inet_addr("192.168.0.22")}}]}) = 0
2750  14:23:51 ioctl(4, SIOCGIFFLAGS, {ifr_name="lo", 
ifr_flags=IFF_UP|IFF_LOOPBACK|IFF_RUNNING}) = 0
2750  14:23:51 ioctl(4, SIOCGIFFLAGS, {ifr_name="enp0s3", 
ifr_flags=IFF_UP|IFF_BROADCAST|IFF_RUNNING|IFF_MULTICAST}) = 0
2750  14:23:51 ioctl(4, SIOCGIFHWADDR, {ifr_name="enp0s3", 
ifr_hwaddr=08:00:27:fd:c3:04}) = 0
2750  14:23:51 poll([{fd=4, events=POLLOUT}, {fd=2, events=POLLIN}], 2, -1) = 1 
([{fd=4, revents=POLLOUT}])
2750  14:23:51 sendto(4, 
"\27\3\3\0014\0\0\0\0\0\0\0\1\371u\372\312D\320\tt\241\312*p<\304\35\317\374\340x"...,
 313, MSG_NOSIGNAL, NULL, 0) = 313
2750  14:23:51 setsockopt(4, SOL_TCP, TCP_CORK, [0], 4) = 0
2750  14:23:51 setsockopt(4, SOL_TCP, TCP_CORK, [1], 4) = 0
2750  14:23:51 poll([{fd=4, events=POLLIN}, {fd=2, events=POLLIN}], 2, -1) = 1 
([{fd=4, revents=POLLIN}])
2750  14:23:51 recvfrom(4, "\27\3\3\3\26", 5, MSG_NOSIGNAL, NULL, NULL) = 5
2750  14:23:51 poll([{fd=4, events=POLLIN}, {fd=2, events=POLLIN}], 2, -1) = 1 
([{fd=4, revents=POLLIN}])
2750  14:23:51 recvfrom(4, 
"\0\0\0\0\0\0\0\1/=\200\255u\240)\27'\217\216\225\214H\235R\200\205mLQ\31s\5"...,
 790, MSG_NOSIGNAL, NULL, NULL) = 790
2750  14:23:51 close(4)                 = 0
2750  14:23:51 close(2)                 = 0
2750  14:23:51 kill(2747, SIGTTOU)      = 0
2750  14:23:51 kill(2747, SIGTTOU <unfinished ...>

What am I missing here?

Best regards

Øyvind Rustad
Product Development Engineer
Wavetrain Systems AS

Web: www.wavetrain.no<http://www.wavetrain.no/>
_______________________________________________
rsyslog mailing list
http://lists.adiscon.net/mailman/listinfo/rsyslog
http://www.rsyslog.com/professional-services/
What's up with rsyslog? Follow https://twitter.com/rgerhards
NOTE WELL: This is a PUBLIC mailing list, posts are ARCHIVED by a myriad of 
sites beyond our control. PLEASE UNSUBSCRIBE and DO NOT POST if you DON'T LIKE 
THAT.

Reply via email to