Skip to content

Commit 8e4c721

Browse files
committed
fix(logfile): store inode as TEXT to prevent OverflowError on Windows/NTFS (fix #1035)
1 parent ff9b9a1 commit 8e4c721

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,7 @@ Monitoring Plugins:
8686
* file-age: handle `FileNotFoundError` race condition when files disappear on busy file systems
8787
* fs-ro: ignore `/run/credentials` (https://systemd.io/CREDENTIALS/)
8888
* keycloak-stats: fix incorrect symlink for lib
89+
* logfile: fix `OverflowError` when inode exceeds SQLite INTEGER range on Windows/NTFS ([#1035](https://github.com/Linuxfabrik/monitoring-plugins/issues/1035))
8990
* ntp-\*: prevent `TypeError: ''=' not supported between instances of 'int' and 'str'`
9091
* valkey-status: fix TLS connection [PR #954](https://github.com/Linuxfabrik/monitoring-plugins/pull/954), thanks to [Claudio Kuenzler](https://github.com/Napsty)
9192

check-plugins/logfile/logfile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ from lib.globals import (STATE_CRIT, STATE_OK, # pylint: disable=C0413
2626
STATE_UNKNOWN, STATE_WARN)
2727

2828
__author__ = 'Linuxfabrik GmbH, Zurich/Switzerland'
29-
__version__ = '2025100601'
29+
__version__ = '2026032401'
3030

3131
DESCRIPTION = """Scans a logfile for a set of patterns or regex and alerts
3232
on the number of matches."""
@@ -245,7 +245,7 @@ def main():
245245
definition = '''
246246
filename TEXT NOT NULL PRIMARY KEY,
247247
offset INTEGER NOT NULL,
248-
inode INTEGER NOT NULL
248+
inode TEXT NOT NULL
249249
'''
250250
lib.base.coe(lib.db_sqlite.create_table(conn, definition, table='file_stats'))
251251
definition = '''
@@ -256,7 +256,7 @@ def main():
256256
'''
257257
lib.base.coe(lib.db_sqlite.create_table(conn, definition, table='matching_lines'))
258258

259-
current_inode = file_stat.st_ino
259+
current_inode = str(file_stat.st_ino)
260260
current_size = file_stat.st_size
261261

262262
old_file_stats = lib.base.coe(lib.db_sqlite.select(

0 commit comments

Comments
 (0)