{"id":13586480,"url":"https://github.com/nodiscc/netdata-logcount","last_synced_at":"2025-05-15T07:34:12.398Z","repository":{"id":86258554,"uuid":"253031064","full_name":"nodiscc/netdata-logcount","owner":"nodiscc","description":"[mirror] Count log messages by level over time - netdata plugin","archived":false,"fork":false,"pushed_at":"2023-07-22T13:56:40.000Z","size":52,"stargazers_count":5,"open_issues_count":0,"forks_count":2,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-02-14T21:28:48.327Z","etag":null,"topics":["monitoring","netdata","syslog"],"latest_commit_sha":null,"homepage":"https://gitlab.com/nodiscc/netdata-logcount","language":"Python","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/nodiscc.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-04-04T15:24:04.000Z","updated_at":"2024-08-01T16:32:31.641Z","dependencies_parsed_at":null,"dependency_job_id":"f1f7011c-1531-43bf-b987-b3cfd25e2e5a","html_url":"https://github.com/nodiscc/netdata-logcount","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nodiscc%2Fnetdata-logcount","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nodiscc%2Fnetdata-logcount/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nodiscc%2Fnetdata-logcount/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nodiscc%2Fnetdata-logcount/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nodiscc","download_url":"https://codeload.github.com/nodiscc/netdata-logcount/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254297366,"owners_count":22047480,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["monitoring","netdata","syslog"],"created_at":"2024-08-01T15:05:35.833Z","updated_at":"2025-05-15T07:34:12.133Z","avatar_url":"https://github.com/nodiscc.png","language":"Python","readme":"# netdata-logcount\n\nCheck/graph the number of syslog messages, by level over time.\n\n![](https://gitlab.com/nodiscc/toolbox/-/raw/master/DOC/SCREENSHOTS/FQqBT7o.png)\n\nThis is a `python.d` plugin for [netdata](https://my-netdata.io/). It parses output from [lnav](https://lnav.org/).\n\nMaximum acceptable number of error/warning/info log messages over the configured time period can be configured, alarms will be raised if log message counts exceed this level.\n\n\n## Installation\n\nThis plugin expects the CSV output of a [lnav](https://lnav.org/) [script](logcount.sql) at `/var/cache/logcount`\n\n```bash\n# install lnav\napt install lnav\n# clone the repository\ngit clone https://gitlab.com/nodiscc/netdata-logcount\n\n# edit configuration values in these files, notably the periodicity of logcount file generation,\n# update interval for the chart and alarms, and warning/critical thresholds for number of log messages\nnano netdata-logcount/health.d_logcount.conf\nnano netdata-logcount/cron.d_logcount\nnano netdata-logcount/logcount.sql\n\n# copy files in place\nsudo mkdir /opt/netdata-logcount\nnetdata_install_prefix=\"/opt/netdata\" # if netdata is installed from binary/.run script\nnetdata_install_prefix=\"\" # if netdata is installed from OS packages\nsudo cp netdata-logcount/logcount.sql /opt/netdata-logcount/logcount.sql\nsudo cp netdata-logcount/cron.d_logcount /etc/cron.d/logcount\nsudo cp netdata-logcount/logcount.chart.py $netdata_install_prefix/usr/libexec/netdata/python.d/\nsudo cp netdata-logcount/python.d_logcount.conf $netdata_install_prefix/etc/netdata/python.d/logcount.conf\nsudo cp netdata-logcount/health.d_logcount.conf $netdata_install_prefix/etc/netdata/health.d/logcount.conf\n\n# generate the initial lgocount file\nsudo lnav -n -f /opt/netdata-logcount/logcount.sql \u003e /var/cache/logcount\nsudo chgrp netdata /var/cache/logcount\nsudo chmod g+r /var/cache/logcount\n\n# restart netdata\nsystemctl restart netdata\n\n```\n\nYou can also install this module using the [`nodiscc.xsrv.monitoring` ansible role](https://gitlab.com/nodiscc/xsrv/-/tree/master/roles/monitoring).\n\n\n## Configuration\n\n- Change log parsing interval in `/etc/cron.d/logcount /opt/netdata-logcount/logcount.sql`\n- Chart refresh time/common `python.d` plugin options can be changed in [`$netdata_install_prefix/etc/netdata/python.d/logcount.conf`](python.d_logcount.conf)\n- Alarm settings can be changed in [`$netdata_install_prefix/etc/netdata/health.d/logcount.conf`](health.d_logcount.conf) (see [Netdata health alarm configuration](https://learn.netdata.cloud/docs/monitor/configure-alarms)). For example, set `to: silent` to prevent sending mail notifications for an alarm.\n\nBrowse logs by running `sudo lnav` from a terminal, and read the [documentation](https://lnav.readthedocs.io/en/latest/)\n\n\n## Debug\n\nTo debug this plugin:\n\n```bash\n$ sudo su -s /bin/bash netdata\n$ $netdata_install_prefix/usr/libexec/netdata/plugins.d/python.d.plugin 1  debug trace logcount\n```\n\nDue to the way the plugins works (parse lnav output generated each X minutes, for messages over last X minutes), message counts shown in the graph represent counts over **the previous period**.\n\n## License\n\n[GNU GPLv3](LICENSE)\n\n## Mirrors\n\n- https://github.com/nodiscc/netdata-logcount\n- https://gitlab.com/nodiscc/netdata-logcount\n\n","funding_links":[],"categories":["Python"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnodiscc%2Fnetdata-logcount","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnodiscc%2Fnetdata-logcount","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnodiscc%2Fnetdata-logcount/lists"}