z

Commercial Support Clients: Clients with support contracts can get escalated support assistance by visiting Nagios Answer Hub. These forums are for community support services. Although we at Nagios try our best to help out on the forums here, we always give priority support to our support clients.

Monitoring drive space with Nagios problem.

This support forum board is for questions relating to Nagios Fusion.

Monitoring drive space with Nagios problem.

Postby AntalGrobinal » Wed Jan 04, 2023 12:00 am

I have nagios installed and running and monitoring the servers onsite
i have added new windows 2019 server, installed same version of NSClient 4.2.0
I added check for drive G, drive G on the server has label (storage)
i have added new windows 2019 server, installed same version of NSClient 4.2.0
but it keep telling me "could not fetch information from server "
this is the way i added the cehck to the server, and am using the same wa for other servers partition and it works fine
i am able to monitor C drive, CPU, RAM, Uptime in this server no problem.
AntalGrobinal
 
Posts: 6
Joined: Fri Sep 23, 2022 9:47 pm

Re: Monitoring drive space with Nagios problem.

Postby MurbiesWalkw » Fri Jan 27, 2023 2:53 am

I've tried it before and it worked, the problem is that the drive is not always connected to the computer because I only use it when I transfer something every month and the System Monitor seem to always forget that I've added the necessary things to monitor it and end up with a blank space.
MurbiesWalkw
 
Posts: 5
Joined: Wed Nov 23, 2022 7:45 pm

Re: Monitoring drive space with Nagios problem.

Postby KayesPotrinak » Fri Feb 17, 2023 7:20 am

I have modified the code to adapt new BASH syntax and omegle.2yu.co more robust check.

#!/bin/bash

usage() { echo "$0 check_nt -H host [-p port] [-w warning] [-c critical] [-l params] [-t timeout]" 1>&2; exit 1; }

while getopts ":H:p:l:w:c:" opt; do
case "${opt}" in
H ) HOST_NAME=$OPTARG;;
p ) PORT=$OPTARG;;
l ) DISC=$OPTARG;;
w ) WARN_THRESHOLD=$OPTARG;;
c ) CRITICAL_THRESHOLD=$OPTARG;;
# t ) TIME_OUT=$OPTARG;;
\?) echo "Invalid option: -$OPTARG" >&2; exit 1 ;;
: ) echo "Option -$OPTARG requires an argument." >&2; exit 1;;
esac
done
shift $((OPTIND-1))

if [[ -z "$HOST_NAME" ]] || [[ -z "$PORT" ]] || [[ -z "$DISC" ]] || [[ -z "$WARN_THRESHOLD" ]] || [[ -z "$CRITICAL_THRESHOLD" ]] ; then
usage
fi

FREESPACE=`/usr/local/nagios/libexec/check_nt -H $HOST_NAME -p $PORT \
-v USEDDISKSPACE -l $DISC | awk -F"- " '{ print $4 }' | awk -F "|" '{ print $1 }'`

SIZE=`echo $FREESPACE | awk '{ print $2 }'`
UNIT=`echo $FREESPACE | awk '{ print $3 }'`

if [[ $UNIT == "Gb" ]];then
SIZE=`echo $SIZE \* 1024 | bc`
fi

if [[ `echo "$SIZE >= $WARN_THRESHOLD" | bc` -eq 1 ]];then
echo "$DISC:\_Drive_Space OK - $FREESPACE"
exit 0
elif [[ `echo "$SIZE $CRITICAL_THRESHOLD" | bc` -eq 1 ]];then
echo "$DISC:\_Drive_Space omeglz echat WARNING - $FREESPACE"
exit 1
elif [[ `echo "$SIZE
KayesPotrinak
 
Posts: 6
Joined: Mon Nov 14, 2022 7:29 am

Re: Monitoring drive space with Nagios problem.

Postby JiliyaNiraya » Tue Mar 21, 2023 4:24 am

It's great to hear that you have Nagios up and running, and that it's successfully monitoring servers onsite. However, it's unfortunate that you're experiencing issues with the new Windows 2019 server that you added.

From your message, it seems that you installed the same version of NSClient 4.2.0 on the new server and attempted to add a check for drive G, which has the label "storage". However, Nagios is giving you an error message saying "could not fetch information from server."

It's strange that this issue is only occurring with the G drive on the new server, since you mentioned that you're able to monitor the C drive, CPU, RAM, and Uptime on the same server without any problems. Have you checked the Nagios logs to see if there are any specific error messages that could help identify the problem? Additionally, have you tried adding a check for the G drive on other servers to see if the issue is unique to this particular server or if it's a broader issue with the way the check is set up?

I recommend looking into these areas and possibly reaching out to Nagios support or forums to see if anyone has experienced similar issues and found a solution.
JiliyaNiraya
 
Posts: 4
Joined: Sun Feb 19, 2023 12:19 am


Return to Nagios Fusion

Who is online

Users browsing this forum: No registered users and 2 guests