Sponsored Content
Top Forums UNIX for Beginners Questions & Answers Zabbix item for last line of a log file Post 303031766 by rbatte1 on Tuesday 5th of March 2019 12:35:33 PM
Old 03-05-2019
Maybe I wasn't clear on the initial post. Sorry about that. The process producing the display doesn't have direct access to the file.

We have multiple CentOS servers running various positions of our application testing programme and I'm being asked to get a display together which shows how they're all doing, batch state etc.. We destroy and re-create them all the time, but the Zabbix agent is in our VMWare template already so that is the mechanism of choice to get the data. It's shouldn't be too hard, but I'm stuck.

The server showing the display doesn't have access to the log file directly (NFS, SMB or an SSH password-less connection defined) If we did have, I could simply tail -1 /path/to/log but because we a frequently rebuilding, I'd rather not have to add another few steps and more complexity between them. There's lots to do already when we build them. With Zabbix, I can get the file contents but only for a small file, and these log files I want to read are very large.

We don't dare have Zabbix remote commands enabled because that is an entry point to attack the server. I know I can define the Zabbix item type as log with a key of log[/path/to/file], but then I don't know how to get at the content/last line.

The files will get quite large, but I can set the history low, because after that we just want the current position.

I'm happy to define the type as log if I could get that to work, but all I get back is a large number. Smilie
Naturally anything I can define in Zabbix will be added to the existing template so I don't have to set that up every time too.


I'm sure I'm missing something simple,
Robin (feeling like a fool Smilie)
 

10 More Discussions You Might Find Interesting

1. Infrastructure Monitoring

A Review of Zabbix - Zabbix Rules! (Part 1)

Tim Bass 03-20-2009 07:02 AM Source... (0 Replies)
Discussion started by: Linux Bot
0 Replies

2. Infrastructure Monitoring

A Review of Zabbix - Zabbix Rules! (Part 2)

Tim Bass 03-23-2009 03:45 PM Source... (0 Replies)
Discussion started by: Linux Bot
0 Replies

3. Shell Programming and Scripting

shell script to read a line in gps receiver log file and append that line to new file

Hi, I have gps receiver log..its giving readings .like below Trying 127.0.0.1... Connected to localhost. Escape character is '^]'. GPSD,R=1 $GPGSV,3,1,11,08,16,328,40,11,36,127,00,28,33,283,39,20,11,165,00*71... (3 Replies)
Discussion started by: gudivada213
3 Replies

4. Shell Programming and Scripting

Searching for file and stopping at first item found

Hello, I try to write a shell script that would list all files on a directory and stop when it finds the first item specified on a find or ls command. How can I tell to the find or ls command to stop when it finds the first ".doc" file for example ? Thank you (7 Replies)
Discussion started by: davchris
7 Replies

5. Shell Programming and Scripting

Reading each item from a formatted file

Hi, I have a file generated like this - 1. Fire SQL and store the formatted output in a temp file echo "select path, empid, age from emp_tbl" | /usr/sql emp_db 2 > count_file | grep vol > tempFile 2. The tempFile looks like this after the above statement /vol/emp1 0732 ... (9 Replies)
Discussion started by: angshuman_ag
9 Replies

6. Shell Programming and Scripting

Print new item in file with symbol

Dear all, I have encountered some problem here. I prompt the user for input and store it into a data file, eg. key in name and marks so the data file will look like this andrew 80 ben 75 and the next input is carine 90. So the problem here is i want to print... (2 Replies)
Discussion started by: branred
2 Replies

7. Shell Programming and Scripting

HELP: Shell Script to read a Log file line by line and extract Info based on KEYWORDS matching

I have a LOG file which looks like this Import started at: Mon Jul 23 02:13:01 EDT 2012 Initialization completed in 2.146 seconds. -------------------------------------------------------------------------------- -- Import summary for Import item: PolicyInformation... (8 Replies)
Discussion started by: biztank
8 Replies

8. Shell Programming and Scripting

Reading line by line from live log file using while loop and considering only those lines start from

Hi, I want to read a live log file line by line and considering those line which start from time stamp; Below code I am using, which read line but throws an exception when comparing line that does not contain error code tail -F /logs/COMMON-ERROR.log | while read myline; do... (2 Replies)
Discussion started by: ketanraut
2 Replies

9. Shell Programming and Scripting

Read a lis, find items in a file from the list, change each item

Hello, I have some tab delimited text data, file: final_temp1 aname val NAME;r'(1,) 3.28584 r'(2,)<tab> NAME;r'(3,) 6.13003 NAME;r'(4,) 4.18037 r'(5,)<tab> You can see that the data is incomplete in some cases. There is a trailing tab after the first column for each incomplete row. I... (2 Replies)
Discussion started by: LMHmedchem
2 Replies

10. Shell Programming and Scripting

Script to process a list of items and uncomment lines with that item in a second file

Hello, I have a src code file where I need to uncomment many lines. The lines I need to uncomment look like, C CALL l_r(DESNAME,DESOUT, 'Gmax', ESH(10), NO_APP, JJ) The comment is the "C" in the first column. This needs to be deleted so that there are 6 spaces preceding "CALL".... (7 Replies)
Discussion started by: LMHmedchem
7 Replies
nfslog.conf(4)						     Kernel Interfaces Manual						    nfslog.conf(4)

NAME
nfslog.conf - NFS server logging configuration file SYNOPSIS
DESCRIPTION
The file specifies the location of the NFS server logs, as well as the location of the private work files used by the NFS server and nfs- logd(1M) daemon during logging. Each entry in the file consists of a mandatory tag identifier and one or more parameter identifiers. The parameter identifier specifies the value or location of the specific parameter. For instance, the parameter identifier specifies the location of the NFS server activity log. The mandatory tag identifier serves as an index into the file to identify the various parameters to be used. At export time, the share_nfs(1M) command specifies the NFS server logging parameters to use by associating a tag from the file to the exported file system. It is legal for more than one file system to be exported using the same logging tag identifier. A "global" tag identifier is included in It specifies the default set of values to be used during logging. If no tag identifier is speci- fied at export time, then the values in the "global" entry are used. The "global" values can be modified by updating this entry in Each entry in the file must contain a mandatory tag identifier and at least one parameter/value pair. If a parameter is not specified in a given entry, the global value of the parameter will be used. The exact entry syntax follows: The entries are described here. Specifies the directory where the log and work files will be placed. This path is prepended to all relative paths specified in other parameters. Specifies the location of the user-readable log file. The log will be located in the unless path is an absolute path. Specifies the location of the private file handle to path mapping database files. These database files are for the private use of the NFS server kernel module and the daemon. These files will be located in the unless path is an absolute path. These database files are permanently stored in the file system. Consult nfslogd(1M) for information on pruning the database files. Specifies the location of the private work buffer file used by the NFS server kernel module to record raw RPC information. This file is later processed by the daemon, which in turn generates the user-readable log file. This work buffer file will be located in the unless path is an absolute path. Sets the format of the user-readable log file. If not specified, the format is used. The format is compatible with log files generated by the Washington University The for- mat provides a more detailed log, which includes directory modification operations not included in the basic format, such as and Note that the format is not compatible with Washington University's log format. WARNINGS
Log files, work files, and file handle to path mapping database can become very large. Be aware of appropriate placement within the file system name space. See nfslogd(1M) for information on pruning the database files and cycling logs. EXAMPLES
Example 1: Using the global Tag The tag may be modified so that all exported file systems that enabled logging use a common set of parameters that conform to the specific needs of the user. These values are used until a specific tag identifier overrides them. Example 2: Overriding the Global defaultdir and logformat Because log files can become very large, it may be desirable to store the log and work files in separate file systems. This can be easily accomplished by simply specifying a different for every file system exported by means of a unique tag: File systems shared with the engineering identifier will have their log and work files located in For instance, the log file will be located at Note that the engineering log file will be stored in the extended format, while the rest of the log files will remain in the basic format. Any of the parameters can be updated in a tag identifier, which overrides the global settings. SEE ALSO
nfslogd(1M), share_nfs(1M). nfslog.conf(4)
All times are GMT -4. The time now is 04:16 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy