{"id":13716384,"url":"https://github.com/ubccr/slurm-exporter","last_synced_at":"2025-04-11T07:59:01.305Z","repository":{"id":45851610,"uuid":"269358516","full_name":"ubccr/slurm-exporter","owner":"ubccr","description":"Slurm Exporter for Prometheus","archived":false,"fork":false,"pushed_at":"2024-08-06T19:11:37.000Z","size":90,"stargazers_count":17,"open_issues_count":4,"forks_count":2,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-03-25T05:36:25.810Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"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/ubccr.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-06-04T12:50:56.000Z","updated_at":"2025-02-19T07:16:32.000Z","dependencies_parsed_at":"2024-08-06T22:10:50.735Z","dependency_job_id":"7e8e775c-8148-4876-9a46-098f5185c3c4","html_url":"https://github.com/ubccr/slurm-exporter","commit_stats":{"total_commits":39,"total_committers":2,"mean_commits":19.5,"dds":0.4358974358974359,"last_synced_commit":"c030e2fe579c7f6e897030bc027b7e602d1b85fd"},"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ubccr%2Fslurm-exporter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ubccr%2Fslurm-exporter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ubccr%2Fslurm-exporter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ubccr%2Fslurm-exporter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ubccr","download_url":"https://codeload.github.com/ubccr/slurm-exporter/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248360122,"owners_count":21090654,"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":[],"created_at":"2024-08-03T00:01:09.929Z","updated_at":"2025-04-11T07:59:01.279Z","avatar_url":"https://github.com/ubccr.png","language":"Go","funding_links":[],"categories":["Monitoring"],"sub_categories":["Prometheus Based"],"readme":"# Slurm Exporter for Prometheus\n\nPrometheus exporter for metrics collected from [Slurm](https://slurm.schedmd.com)\nusing the [REST api](https://slurm.schedmd.com/rest.html).\n\n## Install\n\nDownload the latest release [here](https://github.com/ubccr/slurm-exporter/releases).\n\n```\n$ tar xvzf slurm-exporter-XXX.linux-amd64.tar.gz\n$ sudo cp slurm-exporter-XXX.linux-amd64/slurm-exporter /usr/local/bin\n```\n\n### Create a user for running slurm-exporter \n\n```\n$ sudo groupadd -r prometheus\n$ sudo useradd -r -g prometheus -d /srv/slurmrestd -s /sbin/nologin -c 'prometheus exporter' prometheus\n$ sudo mkdir /srv/slurmrestd\n$ sudo chown prometheus.prometheus /srv/slurmrestd\n```\n\n### Setup and run slurmrestd \n\nServeral methods exist for deploying slurmrestd and in this example we run\nslurmrestd to listen on a unix domain socket using a simple shell script and\nsystemd unit file:\n\nSimple startup script:\n\n```\n$ cat /srv/slurmrestd/start.sh\n#!/bin/bash\n\nrm -f /srv/slurmrestd/slurmrestd.sock\n/sbin/slurmrestd unix:/srv/slurmrestd/slurmrestd.sock\n```\n\nSystemd unit file:\n\n```\n$ cat /etc/systemd/system/slurmrestd.service\n[Unit]\nDescription=Slurm REST service\nAfter=syslog.target network.target sssd.service\n\n[Service]\nType=simple\nUser=prometheus\nGroup=prometheus\nWorkingDirectory=/srv/slurmrestd\nExecStart=/srv/slurmrestd/start.sh\nRestart=always\nRestartSec=5\n\n[Install]\nWantedBy=multi-user.target\n```\n\nStart slurmrestd:\n\n```\n$ sudo systemctl daemon-reload\n$ sudo systemctl start slurmrestd\n```\n\nCheck you can connect to slurmrestd:\n\n```\nsudo -u prometheus curl -vvv -H 'Accept: application/json' --unix-socket /srv/slurmrestd/slurmrestd.sock http:/slurm/v0.0.37/nodes\n```\n\n### Setup and run slurm-exporter\n\nCreate a systemd unit file for running the slurm-exporter:\n\n```\n$ cat /etc/systemd/system/slurm-exporter.service\n[Unit]\nDescription=Prometheus Slurm Exporter\nWants=network-online.target\nAfter=network-online.target slurmrestd.service\n\n[Service]\nUser=prometheus\nGroup=prometheus\nType=simple\nExecStart=/usr/local/bin/slurm-exporter --listen-address=:8080 --unix-socket=/srv/slurmrestd/slurmrestd.sock\nRestart=on-abort\n\n[Install]\nWantedBy=multi-user.target\n```\n\nStart slurm-exporter:\n\n```\n$ sudo systemctl daemon-reload\n$ sudo systemctl start slurm-exporter\n```\n\nCheck you can connect:\n\n```\n$ curl http://localhost:8080/metrics\n```\n\n## Configure slurm-exporter in prometheus\n\n```yml\n- targets:\n  - localhost:8080\n```\n\n## See Also\n\nThis project is loosely based on [prometheus-slurm-exporter](https://github.com/vpenso/prometheus-slurm-exporter)\nand exports similar metric names.\n\n## License\n\nSlurmExporter is released under the GPLv3 license. See the LICENSE file.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fubccr%2Fslurm-exporter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fubccr%2Fslurm-exporter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fubccr%2Fslurm-exporter/lists"}