LinuxQuestions.org
Latest LQ Deal: Linux Power User Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 07-26-2010, 03:26 AM   #1
Xanios
Member
 
Registered: Jul 2010
Posts: 216

Rep: Reputation: 30
nagios in ubuntu 9.10


Hello.

Is there any software that can 'read' the log file in nagios and produce a so-called 'scoreboard' (something like a graph) to display the status of the services?

I was told that one could 'read' the log file stored in nagios and create a scoreboard.

thanks
 
Old 07-26-2010, 04:10 AM   #2
sem007
Member
 
Registered: Nov 2006
Distribution: RHEL, CentOS, Debian Lenny, Ubuntu
Posts: 638

Rep: Reputation: 111Reputation: 111
Hi Xanios,

Quote from official nagios DOC.

Quote:
The nagiostats utility allows you to graph various Nagios performance statistics over time using MRTG.
http://nagios.sourceforge.net/docs/3_0/mrtggraphs.html

OR you can use cacti+nagios

HTH
 
Old 07-26-2010, 04:18 AM   #3
Xanios
Member
 
Registered: Jul 2010
Posts: 216

Original Poster
Rep: Reputation: 30
Hi.

Hmm, so that nagiostats i would have to install it?
 
Old 07-26-2010, 05:35 AM   #4
sem007
Member
 
Registered: Nov 2006
Distribution: RHEL, CentOS, Debian Lenny, Ubuntu
Posts: 638

Rep: Reputation: 111Reputation: 111
Quote:
Hmm, so that nagiostats i would have to install it?
Nagiostat in included in nagios distribution. You have to integrate with MRTG.
 
Old 07-26-2010, 05:44 AM   #5
Xanios
Member
 
Registered: Jul 2010
Posts: 216

Original Poster
Rep: Reputation: 30
But how to integrate? sorry, i don't understand.
 
Old 07-26-2010, 08:12 AM   #6
Xanios
Member
 
Registered: Jul 2010
Posts: 216

Original Poster
Rep: Reputation: 30
log file in nagios

Hello and sorry for posting about the same thing on a new thread. Cause i think i kinda said wrongly for what i wanted to get in the previous thread, so here's a new one.

Hmm, i have to read in the log file in nagios, and maybe output those out on an interface? but not in the form of graph.. i'm currently trying to lets say compute a score board to calculate scores between 2 teams (lets say). if team A manages to kill down the services of team B, then the services count for team B would drop and so on.

So basically, it's like this:

Team A Team B
Service a up down
Service b down down
Service..
..
..

Services up for team A : 3
Services up for team B : 2
Services down for team A : 1
Services down for team B : 1


By the way, i saw this link to read in the log file?But i'm not sure what to go to paste this code?
http://cpansearch.perl.org/src/SAMV/...CLI/Logfile.pm
in http://search.cpan.org/~samv/Nagios-...CLI/Logfile.pm

Last edited by Xanios; 07-26-2010 at 08:14 AM.
 
Old 07-26-2010, 09:46 AM   #7
sem007
Member
 
Registered: Nov 2006
Distribution: RHEL, CentOS, Debian Lenny, Ubuntu
Posts: 638

Rep: Reputation: 111Reputation: 111
You have to install MRTG on server and copy sample configurations into MRTG config file.
Sample configuration available in nagios source (sample-config dir.)

take a look below link to understand how it works.

http://nagios.sourceforge.net/docs/3_0/mrtggraphs.html

HTH
 
Old 07-26-2010, 11:01 AM   #8
alli_yas
Member
 
Registered: Apr 2010
Location: Johannesburg
Distribution: Fedora 14, RHEL 5.5, CentOS 5.5, Ubuntu 10.04
Posts: 559

Rep: Reputation: 92
Hi Xanios,

Welcome to LQ!

Its very difficult to follow what you are asking for - you need to work on writing clearly so that the members of the forum can understand what you're asking and give you the correct answer/s.

Also don't use colloquial/"short form" of words that you find people using on IM or in text messages - this irritates a lot of people and you'll find they won't respond to you.
 
Old 07-26-2010, 11:03 AM   #9
Xanios
Member
 
Registered: Jul 2010
Posts: 216

Original Poster
Rep: Reputation: 30
basically, is there a way to read the log file in nagios? Because in nagios, there is this log file, which contains the status of the current services and so on. So i wanted to find a way to read it and compute a scoreboard (by reading the file i would know what services are down and up etc)
 
Old 07-26-2010, 11:07 AM   #10
alli_yas
Member
 
Registered: Apr 2010
Location: Johannesburg
Distribution: Fedora 14, RHEL 5.5, CentOS 5.5, Ubuntu 10.04
Posts: 559

Rep: Reputation: 92
OK so by "read" I assume you mean pull the log file data into an application and process it?

The Nagios log file is not encrypted as far as I'm aware; so thus this is easily achievable in the programming/scripting language of your choice.

So for example if I was doing what you're trying to do; I'd use Java's File/FileInputStream objects and read and process the data.

You could use any one of multiple scripting languages as well (bash/perl/php) as well which will do this for you.

From what I understand there's no Linux limitation to what you're trying to do as to Linux the log file is just another file. As long as you have permissions to read it; you should be good to go.
 
Old 07-26-2010, 11:13 AM   #11
Xanios
Member
 
Registered: Jul 2010
Posts: 216

Original Poster
Rep: Reputation: 30
Yeah.You're right, i want to pull the log file data into an application and process it.

How to use Java's File/FileInputStream objects? Sorry, i never hear that before. I'm a noob haha Do i have to download it or? And to read the data, do i have to write codes for it? And what would those codes look like? Can i use those i found in the links i gave above?

Really sorry if i sound stupid.

Thanks

Last edited by Xanios; 07-26-2010 at 11:21 AM.
 
Old 07-26-2010, 01:48 PM   #12
Tinkster
Moderator
 
Registered: Apr 2002
Location: in a fallen world
Distribution: slackware by choice, others too :} ... android.
Posts: 23,066
Blog Entries: 11

Rep: Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910
Please do not start two threads on the same subject; merged.
 
Old 07-26-2010, 09:25 PM   #13
Xanios
Member
 
Registered: Jul 2010
Posts: 216

Original Poster
Rep: Reputation: 30
@Tinkster
Okays, sorry about that.

@alli_yas

I tried to use this code to read in the file:

import java.io.*;

public class ReadInput {
public static void main(String[] args) {
try {
File inputFile = new File("/usr/local/nagios/var/nagios.log");
File outputFile = new File("outagain.txt");

FileInputStream fis = new FileInputStream(inputFile);
FileOutputStream fos = new FileOutputStream(outputFile);
int c;

while ((c = fis.read
()) != -1) {
fos.write ( c );
}

fis.close();
fos.close();
} catch (FileNotFoundException e) {
System.err.println("FileStreamsTest: " + e);
} catch (IOException e) {
System.err.println("FileStreamsTest: " + e);
}
}
}

But they gave me "FileStreamsTest: java.io.FileNotFoundException: farrago.txt (The system cannot find the file specified)" in the console output.

I'm stumped.

After reading it the file, i would want to output it in a UI. Hmm.

Last edited by Xanios; 07-26-2010 at 09:26 PM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
LXer: Nagios and Oreon (Nagios web front end) installation and Configuration LXer Syndicated Linux News 1 05-31-2016 08:26 AM
LXer: Ubuntu 10.04: Check IMAP with Nagios LXer Syndicated Linux News 0 05-05-2010 09:30 AM
LXer: How to install Nagios in ubuntu 9.x and 10.04 LXer Syndicated Linux News 0 04-16-2010 03:40 AM
net-snmp-utils to install nagios in Ubuntu linuxcol Ubuntu 1 03-22-2010 04:16 AM
LXer: Install Nagios 3 on Ubuntu 8.10 LXer Syndicated Linux News 0 11-27-2008 08:30 AM


All times are GMT -5. The time now is 05:14 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration