How to get emails on out_of_sync hosts

Hi,

Is there any way a mail can come whenever any host goes out_of_sync
similar to when a host is in the error state?

Regards

Ankush

> Hi,
>
> Is there any way a mail can come whenever any host goes out_of_sync
> similar to when a host is in the error state?

No, but you can probably setup an hourly (or whatever interval) cron,
which sends you the current list of out of sync hosts.
one example could be:
http://theforeman.org/projects/foreman/wiki/Mail_Notifications
alternativy, you can simple run a simple script like this:

curl -s -uadmin:changeme -k
https://foreman/hosts/out_of_sync?format=json |prettify_json.rb

Ohad

··· On Thu, Feb 23, 2012 at 11:22 AM, ankush grover wrote: > > > Regards > > Ankush > > -- > You received this message because you are subscribed to the Google Groups "Foreman users" group. > To post to this group, send email to foreman-users@googlegroups.com. > To unsubscribe from this group, send email to foreman-users+unsubscribe@googlegroups.com. > For more options, visit this group at http://groups.google.com/group/foreman-users?hl=en. >

Good. However, what should be the syntax for out of sync. The below
does not work

rake reports:out_of_sync=somenumber ENV=""

rake reports:out_of_sync=1h RAILS_ENV="production"

··· On Feb 23, 2:28 pm, Ohad Levy wrote: > On Thu, Feb 23, 2012 at 11:22 AM, ankush grover wrote: > > Hi, > > > Is there any way a mail can come whenever any host goes out_of_sync > > similar to when a host is in the error state? > > No, but you can probably setup an hourly (or whatever interval) cron, > which sends you the current list of out of sync hosts. > one example could be:http://theforeman.org/projects/foreman/wiki/Mail_Notifications > alternativy, you can simple run a simple script like this: > > curl -s -uadmin:changeme -khttps://foreman/hosts/out_of_sync?format=json|prettify_json.rb > > Ohad > > > > > > > > > > > Regards > > > Ankush > > > -- > > You received this message because you are subscribed to the Google Groups "Foreman users" group. > > To post to this group, send email to foreman-users@googlegroups.com. > > To unsubscribe from this group, send email to foreman-users+unsubscribe@googlegroups.com. > > For more options, visit this group athttp://groups.google.com/group/foreman-users?hl=en.

rake hosts:scan_out_of_sync RAILS_ENV="production"

··· On Feb 23, 3:56 pm, ankush grover wrote: > Good. However, what should be the syntax for out of sync. The below > does not work > > rake reports:out_of_sync=somenumber ENV="" > > rake reports:out_of_sync=1h RAILS_ENV="production" > > On Feb 23, 2:28 pm, Ohad Levy wrote: > > > > > > > > > On Thu, Feb 23, 2012 at 11:22 AM, ankush grover wrote: > > > Hi, > > > > Is there any way a mail can come whenever any host goes out_of_sync > > > similar to when a host is in the error state? > > > No, but you can probably setup an hourly (or whatever interval) cron, > > which sends you the current list of out of sync hosts. > > one example could be:http://theforeman.org/projects/foreman/wiki/Mail_Notifications > > alternativy, you can simple run a simple script like this: > > > curl -s -uadmin:changeme -khttps://foreman/hosts/out_of_sync?format=json|prettify_json.rb > > > Ohad > > > > Regards > > > > Ankush > > > > -- > > > You received this message because you are subscribed to the Google Groups "Foreman users" group. > > > To post to this group, send email to foreman-users@googlegroups.com. > > > To unsubscribe from this group, send email to foreman-users+unsubscribe@googlegroups.com. > > > For more options, visit this group athttp://groups.google.com/group/foreman-users?hl=en.