tail -f /usr/share/foreman/log/production.log
Successful login: # Woot!
Started POST "/users/login" for 10.0.0.2 at Thu Jan 10 14:50:01 -0800 2013
Processing by UsersController#login as HTML
Parameters: {...}
Bad User Password:
<% list = @hosts.nil? ? @trend : @hosts %> | |
<% list.values.includes(:trendable).in_groups(4, false) do |group| %> | |
<div class="span3"> | |
<td> | |
<% group.each do |host| -%> | |
<ul class="base"> | |
<li> | |
<% opts = host.name? ? host.name : host.fact_value %> | |
<%= link_to(opts, host_path(:id => opts), :title => "Show Host") %> | |
</li> |
irb(main):049:0> a = 0 | |
=> 0 | |
irb(main):050:0> FactValue.where(:fact_name_id => fact_name_id).includes(:fact_name).map do |fact| | |
irb(main):051:1* a += 1 | |
irb(main):052:1> puts fact.value | |
irb(main):053:1> end | |
irb(main):054:0> a | |
=> 6391 | |
irb(main):061:0> FactValue.group(:fact_name_id, :value).where(:fact_name_id => fact_name_id).includes(:fact_name).map do |fact| | |
irb(main):062:1* a += 1 |
[root@test ]# tftp foreman | |
tftp> get pxelinux.0 | |
tftp> quit | |
[root@test ]# ls | grep pxelinux.0 | |
pxelinux.0 |
#! /usr/bin/env ruby | |
# | |
# This scripts runs on remote puppetmasters that you wish to import their nodes facts into Foreman | |
# it uploads all of the new facts its encounter based on a control file which is stored in /tmp directory. | |
# This script can run in cron, e.g. once every minute | |
# if you run it on many puppetmasters at the same time, you might consider adding something like: | |
# sleep rand(10) # that not all PM hammers the DB at once. | |
# ohadlevy@gmail.com | |
# note this requires ruby 1.8.7+ |
# adding these to 60 & 61 | |
# logger.debug "Result: #{ldap_con.get_operation_result.code}" if logger && logger.debug? | |
# logger.debug "Message: #{ldap_con.get_operation_result.message}" if logger && logger.debug? | |
# redMine - project management software | |
# Copyright (C) 2006 Jean-Philippe Lang | |
# | |
# This program is free software; you can redistribute it and/or | |
# modify it under the terms of the GNU General Public License | |
# as published by the Free Software Foundation; either version 2 |
tail -f /usr/share/foreman/log/production.log
Successful login: # Woot!
Started POST "/users/login" for 10.0.0.2 at Thu Jan 10 14:50:01 -0800 2013
Processing by UsersController#login as HTML
Parameters: {...}
Bad User Password:
#!/usr/bin/ruby | |
# Eth0 is better than alphabetical. | |
require 'facter' | |
Facter.add(:macaddress) do | |
has_weight 10 | |
setcode do | |
`facter macaddress_eth0`.strip | |
end |
cd /usr/share/foreman | |
rails c | |
1.9.3-p484 :001 > a = Host.find_by_name 'hostname' | |
1.9.3-p484 :002 > a.interfaces | |
Nic::Base Load (1.2ms) SELECT `nics`.* FROM `nics` WHERE `nics`.`host_id` = 237 | |
+----+-------------------+-------------+----------+------+---------+-----------+-----------+-------------------------+-------------------------+-------------------------+ | |
| id | mac | ip | type | name | host_id | subnet_id | domain_id | attrs | created_at | updated_at | | |
+----+-------------------+-------------+----------+------+---------+-----------+-----------+-------------------------+-------------------------+-------------------------+ | |
| 6 | 5c:f9:dd:f0:a7:50 | 10.199.11.8 | Nic::BMC | | 237 | | | {:username=>"root", ... | 2013-11-27 01:00:37 UTC | 2013-11-27 01:00:37 UTC | | |
+----+-------------------+-------------+----------+------+---------+-----------+-----------+-------------------------+-------------------------+- |
#!/bin/bash | |
# Autostart Libvirt VM's created with Foreman | |
# /usr/share/foreman/config/hooks/host/managed/create/10_autostart_libvirt.sh | |
# Source: http://www.uberobert.com/autostart-libvirt-vms-in-foreman/ | |
. $(dirname $0)/hook_functions.sh | |
username='admin' | |
password='changeme' |