OPENLDAP

Templates, scripts for templates, scripts and requests for templates.

Moderators: Developers, Moderators

Post Reply
Necromago
Posts: 4
Joined: Tue Sep 23, 2014 9:42 am

OPENLDAP

Post by Necromago »

Hello,

I would to query the LDAP Server via this command line :

# ldapsearch -x -b "dc=domain,dc=society,dc=fr" -h localhost | grep dn: | wc -l

This command will give me the count of entry "dn:" contained in my LDAP.

Then I would just have a graph of this value in my CACTI.

Do you think that is possible?

Thank you
Last edited by Necromago on Wed Sep 24, 2014 3:18 am, edited 1 time in total.
Necromago
Posts: 4
Joined: Tue Sep 23, 2014 9:42 am

Re: OPENLDAP

Post by Necromago »

I edited my topic to make it more clear :)
anamta
Posts: 1
Joined: Wed Oct 01, 2014 1:04 am

Re: OPENLDAP

Post by anamta »

is the latency being reported the average latency or the current latency from the latest poll on both the TCP and HTTP scripts?
Last edited by anamta on Tue Oct 21, 2014 12:36 am, edited 1 time in total.
Necromago
Posts: 4
Joined: Tue Sep 23, 2014 9:42 am

Re: OPENLDAP

Post by Necromago »

The latency is not the problem.

My CACTI Server is on a special network.

If I use the command on a server, it'll answer me a number between 50000 and 100000.

That's this number I need to graph...
Necromago
Posts: 4
Joined: Tue Sep 23, 2014 9:42 am

Re: OPENLDAP

Post by Necromago »

Hi,

I used the perl script, <path_cacti>/scripts/ping.pl as an example to make my script ...

Here it is:test_ldap.pl

Code: Select all

#!/usr/bin/perl

# Use open to call a file.sh
open(PROCESS,'ssh root@IP \"/usr/local/bin/test_ldap.sh\" |') || die ("echec: $!\n");
while (<PROCESS>)
{
print $_;
}

close(PROCESS);
The test_ldap.pl lunch this test_ldap.sh on my LDAP Server:

Code: Select all

#!/bin/bash

ldapsearch -x -b "dc=domain,dc=fr" -h localhost | grep dn: | wc -l
- If I run the .sh on the LDAP Server : I recieve a number.
- If I run the .pl on the CACTI Server : I recieve a number.

But CACTI does not make me a graph...

Only some "-nan"

Could you help me to find my mistakes?

Thank you
Post Reply

Who is online

Users browsing this forum: No registered users and 9 guests