Skip to content

Conversation

@ghost
Copy link

@ghost ghost commented Apr 18, 2012

Shell plugins should be able to work with standard nagios plugin ranges, but this is really tedious to do in shell scripts so nobody does. I've written a comprehensive shell function that mirrors the check_range C function from utils_base.c (except that it also parses the range string so it has an extra return path for bad input) and I think it should be included by default.

@ghost ghost assigned weiss May 29, 2012
@weiss
Copy link
Member

weiss commented May 29, 2012

We pulled the commit, thanks.

@weiss weiss closed this May 29, 2012
sni added a commit to sni/monitoring-plugins that referenced this pull request Nov 4, 2024
somehow check_disk crashes on opensuse 15 sp6:

    Core was generated by `.../monitoring-plugins/check_disk -w 80% -c 90% -p /'.
    Program terminated with signal SIGSEGV, Segmentation fault.
    #0  0x00007ffff74ca6b6 in __strlen_sse2 () from /lib64/libc.so.6
    (gdb) bt
    #0  0x00007ffff74ca6b6 in __strlen_sse2 () from /lib64/libc.so.6
    monitoring-plugins#1  0x00007ffff7f81aed in dopr (buffer=0x0, maxlen=0, format=0x40a607 "%s inode=-)%s;", args_in=0x7fffffffda30) at lib/snprintf.c:712
    monitoring-plugins#2  0x00007ffff7f82c6c in smb_vsnprintf (str=0x0, count=0, fmt=0x40a5f0 "%s%s %s %llu%s (%.1f%%", args=0x7fffffffda30) at lib/snprintf.c:1197
    monitoring-plugins#3  0x00007ffff7f82d79 in vasprintf (ptr=0x7fffffffdba8, format=0x40a5f0 "%s%s %s %llu%s (%.1f%%", ap=0x7fffffffda78) at lib/snprintf.c:1232
    monitoring-plugins#4  0x0000000000405cf9 in xvasprintf (strp=0x7fffffffdba8, fmt=<optimized out>, ap=<optimized out>) at utils.c:563
    monitoring-plugins#5  0x0000000000405db7 in xasprintf (strp=strp@entry=0x7fffffffdba8, fmt=fmt@entry=0x40a5f0 "%s%s %s %llu%s (%.1f%%") at utils.c:575
    monitoring-plugins#6  0x0000000000402d9f in main (argc=<optimized out>, argv=<optimized out>) at check_disk.c:434
    (gdb) f 6
    monitoring-plugins#6  0x0000000000402d9f in main (argc=<optimized out>, argv=<optimized out>) at check_disk.c:434
    434               xasprintf (&output, "%s%s %s %llu%s (%.1f%%",
    (gdb) p flag_header
    $1 = 0x1cbf0 <error: Cannot access memory at address 0x1cbf0>
    (gdb)

initializing flag_header helps.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant