akpw / mktxp-stack

MKTXP Exporter monitoring stack
Other
138 stars 24 forks source link

No data in Logs #1

Closed k-szortyka closed 2 years ago

k-szortyka commented 2 years ago

I have No data in dashboard Loki logs, I have None in Routerboard variable. In Mikrotik MKTXP Exporter and System Overview I see all metrics correctly. loki

akpw commented 2 years ago

@k-szortyka, any chance you share the outcome of: /system identity print /system logging print /system logging action print

k-szortyka commented 2 years ago

@akpw

[admin@mikrotik.7.6] > /system identity print 
  name: mikrotik.7.6
[admin@mikrotik.7.6] > /system logging print
Flags: X, I - INVALID; * - DEFAULT
Columns: TOPICS, ACTION, PREFIX
#    TOPICS    ACTION  PREFIX
0  * info      memory        
1  * error     remote  :Info 
2  * warning   disk          
3  * critical  disk          
4 X  l2tp      memory        
5 X  ipsec     disk    tunel 
6 X  ospf      memory        
7    info      remote        
[admin@mikrotik.7.6] > /system logging action print
Flags: * - default 
 0 * name="memory" target=memory memory-lines=1000 memory-stop-on-full=no 

 1 * name="disk" target=disk disk-file-name="log" disk-lines-per-file=5000 disk-file-count=7 disk-stop-on-full=no 

 2 * name="echo" target=echo remember=yes 

 3 * name="remote" target=remote remote=176.107.117.181 remote-port=514 src-address=0.0.0.0 bsd-syslog=yes syslog-time-format=bsd-syslog syslog-facility=local0 syslog-severity=auto 
akpw commented 2 years ago

OK thanks @k-szortyka. Out of the topics, looks like only this one is fully set to send remote logs (prefix is mandatory, otherwise the logs are not recognized):

1  * error     remote  :Info

So I guess the next question is, was there any error logs that was sent to the remote target? If not can you create some and see how things look? Alternatively, you can set the info topic to remote, since it generally most talkative:

/system logging
set 0 action=remote prefix=:Info
k-szortyka commented 2 years ago

@akpw Now I have configuration: `[admin@mikrotik.7.6] > /system logging print Flags: X, I - INVALID; * - DEFAULT Columns: TOPICS, ACTION, PREFIX

TOPICS ACTION PREFIX

0 info remote :Info 1 error remote :Info 2 warning disk
3
critical disk
4 X l2tp memory
5 X ipsec disk tunel 6 X ospf memory
7 info remote `

but still can't see the logs. Logs in Mikrotik are but there is no remote. image

akpw commented 2 years ago

@k-szortyka , just checking do you intend to have two info topics with different prefixes? what happens if you remove the last one?

/system logging remove 7

I updated the dashboard as well, just in case

k-szortyka commented 2 years ago

@akpw I removed it but no change. I have no idea where to look for the reason.

Logs from mktxp container: Error getting PoE info from routerSample-Router@192.168.30.1: ('Error "no such command prefix" executing command b\'/interface/ethernet/poe/print .tag=3794\'', b'no such command prefix')

Logs from promtail container: level=warn ts=2022-11-02T16:28:23.820033376Z caller=syslogtarget.go:161 msg="error initializing syslog stream" err="read tcp 172.172.10.4:1514->172.172.10.6:38419: i/o timeout"

Logs from syslog container: syslog-ng: Error setting capabilities, capability management disabled; error='Operation not permitted'

system logging print: aaa

Mikrotik remote rule: mikrotik

xx is ip address server where stack mktxp is running.

Logs Mikrotik: logs_mikrotik

UPDATE: I deleted all restrictions (security groups on AWS) and the name of the router appeared in Routerboard in the dashboard. But the logs still can't be seen.