Tag Archives: Error Cannot

DHCPserver in LDAP objectClass=dhcpServer not available

By darktux

Hi,

i would like to bind ein dhcpserver to the LDAP. I have here to systems. One Gentoo and one Ubuntu 12.04 LTS. On both systems LDAP is running without problems. So i would like to add the DHCP-Server (is on the same machine) to LDAP.

Ok, i have done this, but the DHCP-Server can’t start, because there is an wrong, or not available objectclass sounds “dhcpServer”. I’ve testet this on both maschines, and there are the same problems. So i think i’ve done something wrong. In the “dhcp.schema” i can find this ojectclass, but when i will add this objectclass, i can’t find it to choose.

Code:

objectclass ( 2.16.840.1.113719.1.203.6.12
NAME 'dhcpServer'
DESC 'DHCP Server Object'
SUP top
MUST (cn $ dhcpServiceDN)
MAY (dhcpVersion $ dhcpImplementation $ dhcpHashBucketAssignment $ dhcpDelayedServiceParameter $ dhcpMaxClientLeadTime $ dhcpFailOverEndp$
X-NDS_CONTAINMENT ('o' 'ou' 'dc') )


My dhcpconfig:

Code:

ldap-server "localhost";
ldap-port 389;
ldap-base-dn "ou=dhcp,ou=services,dc=tux,dc=local";
ldap-dhcp-server-cn "192.168.2.0";
ldap-method dynamic;
ldap-debug-file "/var/log/dhcp-ldap-startup.log";


When i start the dhcp-server:

Code:

Error: Cannot find LDAP entry matching (&(objectClass=dhcpServer)(cn=192.168.2.0,ou=dhcp,ou=services,dc=tux,dc=local))
Configuration file errors encountered -- exiting


And yes this entry is there, but not with this ojectclass.

Here is my ldapobject:

Code:

dn: cn=192.168.2.0,ou=dhcp,ou=services,dc=tux,dc=local
objectClass: top
objectClass: dhcpOptions
objectClass: dhcpSubnet
cn: 192.168.2.0
dhcpNetMask: 24
dhcpRange: 192.168.2.2 192.168.2.100
dhcpOption: domain-name "tux.local"
dhcpOption: domain-name-servers 192.168.2.1, 8.8.8.8
dhcpOption: routers 192.168.2.1
dhcpOption: netbios-name-servers 192.168.2.1
dhcpOption: netbios-node-type 4
dhcpOption: subnet-mask 255.255.255.0
dhcpStatements: default-lease-time 8000
dhcpStatements: max-lease-time 9000


What should i do to add the right ojectclass to this?

…read more
Source: FULL ARTICLE at The UNIX and Linux Forums

Help installling puppet

By samnyc

Hi,

I am trying to instal the puppet. I get this error. Please help..



yum install puppet-server

Loaded plugins: fastestmirror, presto
Loading mirror speeds from cached hostfile
* base: mirrors.greenmountainaccess.net
* extras: mirror.lug.udel.edu
* updates: centos.mirror.constant.com
base | 3.7 kB 00:00
extras | 3.5 kB 00:00
http://yum.puppetlabs.com/e1/6/produ...ata/repomd.xml: [Errno 14] PYCURL ERROR 22 - "The requested URL returned error: 404"
Trying other mirror.
Error: Cannot retrieve repository metadata (repomd.xml) for repository: puppetlabs. Please verify its path and try again


…read more
Source: FULL ARTICLE at The UNIX and Linux Forums

Help capturing output of expect script

By mrkz1974

Hello there. I have an expect script that I use to routinely apply certain commands to all Cisco routers within our SSH network. The output file has been modified so only loopback IP addresses are shown if it ran succesfully, like this:

*******************************************
SSH Login successful for 10.x.x.1
*******************************************
SSH Login successful for 10.x.x.2
*******************************************
etc…

We recently transitioned to SSH, (and since I’m a network guy and not a programmer it was a PAIN to make this work). There is a request now to capture ALL the expect output and I’m wondering what the best way to do this would be without changing the edited output. Maybe write the whole thing to another file, maybe using another script to capture all the log from this script, I don’t know. Here’s the script:

Code:

#!/usr/local/bin/expect -f
proc sshLoginV2 {host} {
set timeout 10
set sshUser "USER"
set sshPass "PASS"
spawn -noecho /usr/bin/ssh -o StrictHostKeyChecking=no $sshUser@$host
expect {
"assword:" {
send "$sshPassr"
expect {
"*#" {
return "success: logged in via SSH to $host"
}
"Access denied" {
return "error: access denied, incorrect password sent to $host"
}
}
}
timeout {
return "error: SSH login to $host timed out"
}
eof {
return "error: connection to $host failed"
}
}
}
#---open input file
set infile [open IPLIST r]
#---set the send_slow variable to 1.05 seconds
set send_slow {1 .01}
#---set output file variable
set outfile [open SCRIPT-RESULTS.txt w]
#---set expect timeout variable to 10 seconds
set timeout 7
#---turn off screen logging
log_user 0
#---foreach line in the input file
foreach host [split [read $infile] "n"] {
#---have to flush STDOUT buffer on each iteration of loop
flush $outfile
puts $outfile "*******************************************"
#---set PID variable with pid of spawned ping
spawn /usr/sbin/ping6 $host
set pingSpId $spawn_id
expect {
-i $pingSpId eof {
catch {exp_close -i $pingSpId} a
catch {exp_wait -i $pingSpId} b
}
-i $pingSpId timeout {
puts "Ping timed out for $host"
puts $outfile "Error: Cannot ping $host"
puts $outfile "*******************************************n"
catch {exp_close -i $pingSpId} a
catch {exp_wait -i $pingSpId} b
continue
}
-i $pingSpId "no answer from $host" {
puts "No answer from $host"
puts $outfile "Error: Cannot ping $host"
puts $outfile "*******************************************n"
catch {exp_close -i $pingSpId} a
catch {exp_wait -i $pingSpId} b
continue
}
-i $pingSpId "unknown host $host" {
puts "Unknown host $host"
puts $outfile "Error: Cannot ping $host"
puts $outfile "*******************************************n"
catch {exp_close -i $pingSpId} a
catch {exp_wait -i $pingSpId} b
continue
}
-i $pingSpId "0 packets received" {
puts "Cannot ping host $host, 0 packets received"
puts $outfile "Error: Cannot ping $host"
puts $outfile "*******************************************n"
catch {exp_close -i $pingSpId} a
catch {exp_wait -i $pingSpId} b
continue
}
-i $pingSpId "$host is alive" {
puts "$host is alive"
catch {exp_close -i $pingSpId} a
catch {exp_wait -i $pingSpId} b
}
}
#---call sshLogin proc from common.tcl
set sshMsg [sshLoginV2 $host]
if {[regexp "error" $sshMsg]} {
puts $outfile "SSH Login failed for $host"
puts $outfile "Reason: $sshMsg"
continue
} elseif {[regexp "success" $sshMsg]} {
puts $outfile "SSH Login successful for $host"
} else {
puts $outfile "Not sure what happened to SSH login for $host"
continue
}
set tlntSpId $spawn_id
#---hit the enter key once, just to see prompt
send -s -i $tlntSpId "r"
expect {
-i $tlntSpId eof {
catch {exp_close -i $tlntSpId} a
catch {exp_wait -i $tlntSpId} b
}
-i $tlntSpId timeout {
puts $outfile "error: do not see switch prompt"
puts $outfile "*******************************************n"
send "exitr"
catch {exp_close -i $tlntSpId} a
catch {exp_wait -i $tlntSpId} b
}
-i $tlntSpId "*#"
}
#---set terminal length to 0
send -s -i $tlntSpId "term len 0r"
expect {
-i $tlntSpId eof {
catch {exp_close -i $tlntSpId} a
catch {exp_wait -i $tlntSpId} b
}
-i $tlntSpId timeout {
puts $outfile "error: timeout sending code to $host"
puts $outfile "*******************************************n"
send "exitr"
catch {exp_close -i $tlntSpId} a
catch {exp_wait -i $tlntSpId} b
}
-i $tlntSpId "*#"
}
#---send commands
send -s -- "sh dlsw transparent map r"
expect *
sleep .1
send -s -- "sh int loopback 0 | incl 10.r"
expect *
sleep .2
send -s -- "exitr"
puts $outfile "*******************************************n"
flush $outfile
#---send exit to switch
send -s -i $tlntSpId "exitr"
expect {
-i $tlntSpId eof {
catch {exp_close -i $tlntSpId} a
catch {exp_wait -i $tlntSpId} b
}
-i $tlntSpId timeout {
puts $outfile "error: timeout exiting $member on $host"
puts $outfile "*******************************************n"
send "exitr"
catch {exp_close -i $tlntSpId} a
catch {exp_wait -i $tlntSpId} b
}
}
}
close $outfile


To recap, I’m looking to write for the whole logging output to another file and I’m wodering what is the best way to do this. Thanks!

Source: FULL ARTICLE at The UNIX and Linux Forums