{"id":18084114,"url":"https://github.com/oanderoficial/monitor_certificate_validity","last_synced_at":"2026-05-04T05:39:11.867Z","repository":{"id":260101386,"uuid":"874869975","full_name":"oanderoficial/monitor_certificate_validity","owner":"oanderoficial","description":"Monitorar validade de certificados no Windows.","archived":false,"fork":false,"pushed_at":"2024-10-29T12:24:51.000Z","size":12,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-05T23:42:25.551Z","etag":null,"topics":["certificate","powershell","powershell-script","windows"],"latest_commit_sha":null,"homepage":"","language":"PowerShell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/oanderoficial.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2024-10-18T15:58:42.000Z","updated_at":"2025-01-11T18:25:34.000Z","dependencies_parsed_at":"2024-10-29T15:13:54.624Z","dependency_job_id":null,"html_url":"https://github.com/oanderoficial/monitor_certificate_validity","commit_stats":null,"previous_names":["oanderoficial/monitor_certificate_validity"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/oanderoficial/monitor_certificate_validity","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oanderoficial%2Fmonitor_certificate_validity","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oanderoficial%2Fmonitor_certificate_validity/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oanderoficial%2Fmonitor_certificate_validity/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oanderoficial%2Fmonitor_certificate_validity/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/oanderoficial","download_url":"https://codeload.github.com/oanderoficial/monitor_certificate_validity/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oanderoficial%2Fmonitor_certificate_validity/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32596533,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-03T22:12:39.696Z","status":"online","status_checked_at":"2026-05-04T02:00:06.625Z","response_time":58,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["certificate","powershell","powershell-script","windows"],"created_at":"2024-10-31T15:05:45.746Z","updated_at":"2026-05-04T05:39:11.850Z","avatar_url":"https://github.com/oanderoficial.png","language":"PowerShell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Monitor certificate validity\n\nMonitorar validade de certificados no Windows.\n\n\u003ch2\u003eComandos úteis: \u003c/h2\u003e\n\n *  Listar certificados pessoais\n   ```ps1\nGet-ChildItem Cert:\\LocalMachine\\My\n```\n\n*  Listar certificados de raiz\n ```ps1\nGet-ChildItem Cert:\\LocalMachine\\Root\n```\n\n*  Listar certificados de autoridades de certificação\n ```ps1\nGet-ChildItem Cert:\\LocalMachine\\CA\n```\n\n* Listar todos os certificados da máquina local\n```ps1\nGet-ChildItem Cert:\\LocalMachine\n```\n\u003cbr\u003e\n\n```ps1\n# Configura a política de execução para a sessão atual\nSet-ExecutionPolicy RemoteSigned -Scope Process -Force\n\n$certificado = \"Cert:\\LocalMachine\\Root\\AD7E1C28B064EF8F6003402014C3D0E3370EB58A\"\n$logsave = \"C:\\Zabbix\\scripts\\cert.log\"\n \n$comando = Get-Item $certificado\n$expirar = $comando.NotAfter\n$diasrestantes = ($expirar - (Get-Date)).Days\n \n$retorna = $diasrestantes\n \nSet-Content -Path $logsave -Value $retorna\n```\n\n```ps1\n\n$certificado = \"Cert:\\CurrentUser\\My\\AD7E1C28B064EF8F6003402014C3D0E3370EB58A\"\n$logsave = \"C:\\Apps\\Cert\\log.txt\"\n\n\n$comando = Get-Item $certificado\n$expirar =$comando.NotAfter\n$diasrestantes = ($expirar - (Get-Date)).Days\n\nif ($diasrestantes -le 30) {\n    $retorna = 1 \n} else{\n    $retorna = 0\n}\n\nSet-Content -Path $logsave -Value $retorna\n```\n\n\u003ch2\u003e Implementando no Zabbix \u003c/h2\u003e\n\n\u003cstrong\u003e Criação do item: \u003c/strong\u003e \n\n![image](https://github.com/user-attachments/assets/1c54b4c4-853e-4be8-900c-f214b2f72846)\n\n\u003cstrong\u003e Trigger de exemplo: \u003c/strong\u003e \n\n![image](https://github.com/user-attachments/assets/347c43be-a283-4e07-a670-25dbd29aacba)\n\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foanderoficial%2Fmonitor_certificate_validity","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Foanderoficial%2Fmonitor_certificate_validity","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foanderoficial%2Fmonitor_certificate_validity/lists"}