-
Notifications
You must be signed in to change notification settings - Fork 16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cannot set downtime to service #3
Comments
Hey @techadrian, The label of the field is hardcoded as
which is incorrect because it does not take the configuration of the date format into account. You want to double check the actual format you are using. The configuration value you are looking for is "date_format" inside of naemon.cfg. On an OP5 Monitor installation, this can be found through `grep date_format naemon.cfg. On an OP5 Monitor installation, this should do it for you:
If you are using Ninja/Naemon/Merlin on your own hand, you will find naemon.cfg in another path. Once you got the configuration value, which in my example is iso8601, you can look for the expanded date format in this file: ninja/application/helpers/date.php. Here's a relevant link for you: https://github.com/op5/ninja/blob/eeae3cfeee1/application/helpers/date.php#L148-L160 |
Hi chelmertz, Thank you so much for pointing me to the right direction. My fix was : change from nagios.cfg in naemon.cfg in date.php Do you think we can adjust the code to treat this exception? Cheers, |
Hi again Adrian, Thanks for digging in! In OP5 Monitor (the product that we sell, that includes Ninja), we actually symlink nagios.cfg to naemon.cfg as one way to handle legacy installations. I don't think we have ever reflected on this particular issue from the OSS PoV, but I really think that we should abstract it away, so that you do not have to change parts of the code inside of the product. I'm thinking that the date_format probably should reside in a Ninja configuration file instead (application/config/date.php or such). It may then differ to whatever is inside of nagios.cfg/naemon.cfg but at least it is coherent with the rest of Ninja, which I think is a good thing. What do you think about that? |
Hi Carl, Moving date_format setting in ninja from a "complete dinamic" method by looking in nagios.cfg/naemon.cfg to a configuration like application/config/date.php would be too much in my opinion since we create a config file for only one value. If there would have been more values regarding date .....yeah.....that would work ...but using it only for date_format .... The most easy way I see doing that is in https://github.com/op5/ninja/blob/eeae3cfeee1/application/helpers/date.php and add a default value. Hope that helps. Cheers, |
Hi Guys,
Been trying to implement ninja with merlin and naemon and got stuck at downtime setting for services :
Selecting start time and endtime like this 2017-01-26 01:00:00 and 2017-01-27 01:00:00 I got the following error :
There was an error submitting your command to Ninja.
ERROR: 2017-01-26 00:00:00 is not a valid date, please adjust it
Tried different formats, it does not work .....
Log states :
Failed to submit command 'schedule_downtime' on (services) object 'hplj2605dn;PING' Output: 2017-01-26 01:00:00 is not a valid date, please adjust it
Any chance you can have a look at this ?
Thanks,
Adrian
The text was updated successfully, but these errors were encountered: