{"id":23592593,"url":"https://github.com/filipnet/ups-telegram-notify","last_synced_at":"2025-05-07T19:23:14.621Z","repository":{"id":166014477,"uuid":"641429697","full_name":"filipnet/ups-telegram-notify","owner":"filipnet","description":"Notification of the status of an Uninterruptible Power Supply by Telegram","archived":false,"fork":false,"pushed_at":"2024-06-28T11:11:23.000Z","size":32,"stargazers_count":14,"open_issues_count":1,"forks_count":4,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-03-31T13:18:36.893Z","etag":null,"topics":["notification","nut","script","shell-script","state","telegram","uninterruptible-power-supply","ups"],"latest_commit_sha":null,"homepage":"","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/filipnet.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":"2023-05-16T13:00:10.000Z","updated_at":"2025-01-29T09:20:43.000Z","dependencies_parsed_at":null,"dependency_job_id":"bb696749-3ecc-4564-9323-69628081cc28","html_url":"https://github.com/filipnet/ups-telegram-notify","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/filipnet%2Fups-telegram-notify","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/filipnet%2Fups-telegram-notify/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/filipnet%2Fups-telegram-notify/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/filipnet%2Fups-telegram-notify/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/filipnet","download_url":"https://codeload.github.com/filipnet/ups-telegram-notify/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252941789,"owners_count":21828937,"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":["notification","nut","script","shell-script","state","telegram","uninterruptible-power-supply","ups"],"created_at":"2024-12-27T08:14:46.778Z","updated_at":"2025-05-07T19:23:14.599Z","avatar_url":"https://github.com/filipnet.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ups-telegram-notify\nNotification of the status of an Uninterruptible Power Supply by Telegram\n\n\u003cimg src=\"images\\telegram-notification-example.png\" alt=\"Telegram notification example\" width=\"400\" align=\"right\"/\u003e\nIn the event of a power failure, you may want to be notified in order to check systems that are not protected. It is also interesting to know whether there has been a prolonged power failure and whether measures have been initiated in the form of shutdowns. To realise this via the messanger Telegram, this Linux script solution can be used.\n\n## REQUIREMENT DEPENDENCIES\n\nDebian: ```apt-get install nut```\n\nRedhat: ```dnf install nut -y```\n\n## NUT CONFIGURATION EXAMPLE\n\n### /etc/nut/ups.conf\n```\n[eaton]\n   driver = usbhid-ups\n   port = auto\n   vendorid = 0463\n   pollfreq = 30\n```\n### /etc/nut/nut.conf\n```\nMODE=netserver\nLISTEN 0.0.0.0 3493\nLISTEN ::1 3493\n```\n### /etc/nut/upsd.user\n```\n[upsmon]\n      password = supersecretpassword\n      upsmon master\n      actions = SET\n      instcmds = ALL\n```\n### /etc/nut/upsmon.conf\n```\nMONITOR eaton@127.0.0.1 1 upsmon supersecretpassword master\nPOWERDOWNFLAG /etc/killpower\nSHUTDOWNCMD \"/sbin/shutdown -h now\"\n```\n### Enable and starting service\n```\nsudo systemctl enable nut-server.service \u0026\u0026 sudo systemctl start nut-server.service\nsudo systemctl enable nut-monitor.service \u0026\u0026 sudo systemctl start nut-monitor.service\nsudo systemctl status nut-server.service\nsudo systemctl status nut-monitor.service\nnetstat -tulpen |grep 3493\n```\n\n## DOWNLOAD AND INSTALLATION \n\nDownload von Notification Script von Github-Repository\n```\ncd  /etc/nut\nwget https://raw.githubusercontent.com/filipnet/ups-telegram-notify/main/notifycmd.sh\nchmod +x notifycmd.sh\n```\n\n## CONFIGURATION \n\nDon´t forget to change the first lines ```GROUP_ID```and ```BOT_TOKEN``` Parameters inside the script.\n\nOpen file ```/etc/nut/upsmon.conf```with your favorite editor (vim/nano) and add the following lines to the end of the config file.\n\n```\n# Email script for NOTIFYCMD\nNOTIFYCMD \"/etc/nut/notifycmd.sh\"\n\n# Notification events\nNOTIFYFLAG ONLINE     SYSLOG+WALL+EXEC\nNOTIFYFLAG ONBATT     SYSLOG+WALL+EXEC\nNOTIFYFLAG LOWBATT    SYSLOG+WALL+EXEC\nNOTIFYFLAG FSD        SYSLOG+WALL+EXEC\nNOTIFYFLAG COMMOK     SYSLOG+WALL+EXEC\nNOTIFYFLAG COMMBAD    SYSLOG+WALL+EXEC\nNOTIFYFLAG SHUTDOWN   SYSLOG+WALL+EXEC\nNOTIFYFLAG REPLBATT   SYSLOG+WALL+EXEC\nNOTIFYFLAG NOCOMM     SYSLOG+WALL+EXEC\nNOTIFYFLAG NOPARENT   SYSLOG+WALL+EXEC\n```\n\nRestart nut services to take affect\n```\nsudo systemctl restart nut-server.service\nsudo systemctl restart nut-driver.service\nsudo systemctl restart nut-monitor.service\n```\n## TEST / DRY-RUN\n\nExecute the script: \n```\ncd /etc/nut/\n./notifycmd.sh\n```\n## LICENSE \n\nups-telegram-notify and all individual scripts are under the BSD 3-Clause license unless explicitly noted otherwise. Please refer to the LICENSE\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffilipnet%2Fups-telegram-notify","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffilipnet%2Fups-telegram-notify","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffilipnet%2Fups-telegram-notify/lists"}