This is nothing to do with systemd.

Type the following command at the shell prompt:

/usr/local/bin/snmp_exporter

Show what error it returns.  It will almost certainly tell you that the 
binary is bad.  If so, you either need to download or build a fresh 
snmp_exporter binary.

On Wednesday, 13 October 2021 at 09:05:41 UTC+1 umus...@gmail.com wrote:

> Hey,
> Thanks for your response.
>
> I have changed the systemd file, yet the same error.
>
> grafana:~# systemctl status snmp-exporter.service
> ● snmp-exporter.service - Prometheus SNMP Exporter Service
>      Loaded: loaded (/etc/systemd/system/snmp-exporter.service; enabled; 
> vendor preset: enabled)
>      Active: failed (Result: exit-code) since Wed 2021-10-13 12:02:03 +04; 
> 11s ago
>     Process: 683678 ExecStart=/usr/local/bin/snmp_exporter (code=exited, 
> status=203/EXEC)
>    Main PID: 683678 (code=exited, status=203/EXEC)
>
> Oct 13 12:02:03 grafana systemd[1]: Started Prometheus SNMP Exporter 
> Service.
> Oct 13 12:02:03 grafana systemd[683678]: snmp-exporter.service: Failed to 
> execute command: Exec format error
> Oct 13 12:02:03 grafana systemd[683678]: snmp-exporter.service: Failed at 
> step EXEC spawning /usr/local/bin/snmp_exporter: Exec format error
> Oct 13 12:02:03 grafana systemd[1]: snmp-exporter.service: Main process 
> exited, code=exited, status=203/EXEC
> Oct 13 12:02:03 grafana systemd[1]: snmp-exporter.service: Failed with 
> result 'exit-code'.
>
> _________________
>
> Initially I had installed snmp_exporter, but I was unable to get the 
> instance up for my cisco switch (thought local host and snmp_exporter 
> service was running and I was even able to do snmpwalk to my switch). So I 
> removed it and then I installed snmp_exporter generator and that is 
> generating the snmp_exporter file. But after installing this the service 
> itself never came up. 
>
>
>
>
>
>
>
>
> On Wednesday, October 13, 2021 at 11:54:27 AM UTC+4 Brian Candler wrote:
>
>> "Exec format error" = the binary is invalid = there was a problem with 
>> how you built the binary.
>>
>> I expect you'll get the same error running the binary directly at the 
>> command line: try
>> /usr/local/bin/snmp_exporter
>> and see if that gives a better error message.  Also see if "ldd 
>> /usr/local/bin/snmp_exporter" gives you any clues.
>>
>> This is the sort of error you'd get if you built the binary to run on 
>> Linux but you're trying to run it on a Mac, for example.
>>
>> On Wednesday, 13 October 2021 at 06:47:36 UTC+1 umus...@gmail.com wrote:
>>
>>> Hi,
>>>
>>> I have recently installed snmp_exporter generator, which is generating 
>>> the snmp_exporter file.
>>> But this service shows failed. I have tried to change the systemd file 
>>> and give various paths. Also moved the snmp.yml file to different location 
>>> but still service is failed Following is the output. Can any one help?
>>>
>>> grafana:~# systemctl status snmp-exporter.service
>>> ● snmp-exporter.service - Prometheus SNMP Exporter Service
>>> Loaded: loaded (/etc/systemd/system/snmp-exporter.service; enabled; 
>>> vendor preset: enabled)
>>> Active: failed (Result: exit-code) since Tue 2021-10-12 13:07:18 +04; 8s 
>>> ago
>>> Process: 469550 ExecStart=/usr/local/bin/snmp_exporter 
>>> --config.file=/usr/local/bin/snmp.yml (code=exited, status=203/EXEC)
>>> Main PID: 469550 (code=exited, status=203/EXEC)
>>>
>>> Oct 12 13:07:18 grafana systemd[1]: Started Prometheus SNMP Exporter 
>>> Service.
>>> Oct 12 13:07:18 grafana systemd[469550]: snmp-exporter.service: Failed 
>>> to execute command: Exec format error
>>> Oct 12 13:07:18 grafana systemd[469550]: snmp-exporter.service: Failed 
>>> at step EXEC spawning /usr/local/bin/snmp_exporter: Exec format error
>>> Oct 12 13:07:18 grafana systemd[1]: snmp-exporter.service: Main process 
>>> exited, code=exited, status=203/EXEC
>>> Oct 12 13:07:18 grafana systemd[1]: snmp-exporter.service: Failed with 
>>> result 'exit-code'.
>>>
>>

-- 
You received this message because you are subscribed to the Google Groups 
"Prometheus Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to prometheus-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/prometheus-users/67d46e9e-376b-4f85-a152-ad5dac6c27acn%40googlegroups.com.

Reply via email to