- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: Memory negative result in Nagios Script
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Forums
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-22-2009 06:16 AM
тАО12-22-2009 06:16 AM
Re: Memory negative result in Nagios Script
# TOTALMEM=$(($TOTALMBMEM * 1024))
Actually no need to use any stinkin' "$" for arithmetic evaluation:
(( TOTALMEM = TOTALMBMEM * 1024 ))
>TTr: The first error appears at the ... which is calculated as USEDMEM=$(($USEDPAGES * $PAGESIZE / 1024)).
You can change the order to:
(( USEDMEM = USEDPAGES * (PAGESIZE / 1024) ))
>TOTALMEM=`echo "$TOTALMBMEM * 1024" | /usr/bin/bc`
You shouldn't go backwards and use `` vs $():
TOTALMEM=$(echo "$TOTALMBMEM * 1024" | /usr/bin/bc)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-28-2009 07:57 AM
тАО12-28-2009 07:57 AM
Re: Memory negative result in Nagios Script
I'm trying to when it goes over 100% then set variable to 100. With lines:
if [ $var -eg 100 ]; then
$VAR=100
fi
But does not work like this.
Other way of doing this?
regards,
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-28-2009 08:22 AM
тАО12-28-2009 08:22 AM
Re: Memory negative result in Nagios Script
> $VAR=100
> fi
> But does not work like this.
"does not work" is not a useful problem
description. What happens? Error messages?
Compare:
$var $VAR
-eg -ge
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-28-2009 08:53 AM
тАО12-28-2009 08:53 AM
Re: Memory negative result in Nagios Script
I used the following:
if [ $VAR-ge 100 ]; then
VAR=$((100))
fi
Regards!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-28-2009 10:57 AM
тАО12-28-2009 10:57 AM
Re: Memory negative result in Nagios Script
No need to do something that complicated.
VAR=100
(( VAR = 100 ))
- « Previous
-
- 1
- 2
- Next »