I encountered an error while following the guide to set up Nagios plugins. Specifically, when attempting to add a cron job, I received the following error message:
root@lpslibrenms1:/etc/cron.d# */5 * * * * librenms /opt/librenms/services-wrapper.py 1
bash: */5: No such file or directory
Interestingly, when I list the contents of the librenms folder using the ls command, I can see the services-wrapper.py file. However, I'm confused about the presence of a .py 1 file.
Could you provide further clarification or guidance regarding the intended usage or purpose of the .py 1 file in this context?
What causes the 'No such file or directory' error when adding a cron job?
-
- Posts: 7
- Joined: Sun Jan 01, 2023 8:15 am
Re: What causes the 'No such file or directory' error when adding a cron job?
That looks like a cron syntax issue having nothing to do with nagios. Try man cron.
-
- Posts: 1
- Joined: Sun Jul 23, 2023 8:27 pm
Re: What causes the 'No such file or directory' error when adding a cron job?
That seems to be an issue with the syntax of cron and has nothing to do with nagios. If you want to use man cron, you can.
-
- Posts: 2
- Joined: Thu Jun 22, 2023 9:01 pm
Re: What causes the 'No such file or directory' error when adding a cron job?
As mentioned previously, a crontab is a special file that holds the schedule of jobs cron will run.
Mapquest Directions
Mapquest Directions
-
- Posts: 1
- Joined: Sun Jan 21, 2024 12:50 pm
Re: What causes the 'No such file or directory' error when adding a cron job?
Thanks for help guysCharmaine wrote: ↑Mon Jul 17, 2023 11:25 pmthanks for your post. When setting up a cron job, it will run in the context of a specific user. If the file or folder belongs to another user or resides in a user-specific folder, the cron job may not have access to it, resulting in the error "No such file or directory" .TeetharKehar wrote: ↑Fri Jul 14, 2023 6:27 am I encountered an error while following the guide to set up Nagios plugins. Specifically, when attempting to add a cron job, I received the following error message:
root@lpslibrenms1:/etc/cron.d# */5 * * * * librenms /opt/librenms/services-wrapper.py 1
bash: */5: No such file or directory
Interestingly, when I list the contents of the librenms folder using the ls command, I can see the services-wrapper.py file. However, I'm confused about the presence of a .py 1 file.
Could you provide further clarification or guidance regarding the intended usage or purpose of the .py 1 file in this context? Depositphotos