Linux - NewbieThis 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
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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.
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
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.
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.
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)
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.
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?
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 );
}
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.